IceChat Forums

IceChat 7 => IceChat 7 Scripts => Topic started by: angelicwhimpers on February 21, 2015, 05:42:25 PM

Title: Profile script needed
Post by: angelicwhimpers on February 21, 2015, 05:42:25 PM

 i have a hard script i would love to have made... it is a profile script. i would like that apon entering the room it will either state; they do not have a profile and can set one up by typeing !setup, or it will show the intro that they have entered before when they set up the profile previsly.

i would like the profile to have 10 different feilds, such as age, location, description, and so on (can fill in the names of the feilds later) for now we can list them as FEILD 1 , FEILD 2, FEILD 3, and so on... the last feild would be the intro, the thing used when the person enters the room.

to beable to see the profile for any said person someone would type in something like !view <nick>. when that is typed that person will get a notice or msg with the profile of the person they wish to see (if they person dosnt have a profile it would tell them, <nick> dose not have a profile yet.) if there is a profile they would then get a msg or notice with said info... ex.

Profile for <nick>
Age: <person fills in>
Sex: <person fills in>
Location: <person fills in>
FEILD 4: <person fills in>
FEILD 5: <person fills in>
FEILD 6: <person fills in>
FEILD 7: <person fills in>
FEILD 8: <person fills in>
FEILD 9: <person fills in>
Intro: <person fills in>

when a person first joins the room it would find there profile in his memorie bank and send out the persons intro then after it say something like "For there full profile please type !view <nick>."

i hope that makes sense and you can understand it. would greatly love anyone that could help me out!!!
if it helps i am running icechat 7.8
Title: Re: Profile script needed
Post by: Morio on February 23, 2015, 07:50:28 AM
Writing this script would not be too challenging, but it's a lot of mechanical work, which is why I think you'll have trouble finding someone to do it for you. You can of course as for help if you have specific questions.

I would suggest you store the information in an ini file. This unfortunately limits each entry to 255 characters unless you make your own parser for ini files, but depending on what you want people to enter into the different fields, 255 characters might be enough.

Code: [Select]
WriteIniFile "somefile.ini", "section", "item", "value"
GetIniFile("somefile.ini", "section", "item","defaultvalue")

If the ini file does not contain what you are trying to search for it will return "defaultvalue"

So, first you need to make a command that allows people to store information to their profile. This could be done by having them type "!set age xx" or "!set sex xx" (without quotes). This could be done by something like this inside a ONTEXT or ONQUERY sub:

Code: [Select]
If Left(Message,5) = "!set " and len(Message) >5 then
messageArr = Split(Message," ") 'split the message into an array where each word is one item in the array
If UBound(messageArr) < 2 then exit sub 'there needs to be at least 3 words, otherwise the script terminates
Select Case messageArr(1) 'look at the second word
Case "age"
WriteIniFile "somefile.ini", Nickname, "age", messageArr(2) 'store the third word into the ini file
Case "sex"
WriteIniFile "somefile.ini", Nickname, "sex", messageArr(2)
Case "description"
WriteIniFile "somefile.ini", Nickname, "description", Mid(Message,17) 'store everything after !set description
End Select
End If

To retrieve the information you can pretty much do the same, but use something like:

Code: [Select]
SomeVariable = GetIniFile("somefile.ini", Nickname, "age", "")

You might want to add some code to check that you aren't trying to store more than 255 characters like:
Code: [Select]
If Len(SomeString) > 255 then...

If you don't want to use ini files, you can for example use for example an access database which allows for much more functionality than ini files, but you will have to figure out that by yourself as databases are not something I'm very familiar with.
Title: Re: Profile script needed
Post by: angelicwhimpers on February 23, 2015, 09:52:43 PM
none of this is something i am very fimiliar with i can change things and tweek things but so far that is all.
Title: Re: Profile script needed
Post by: angelicwhimpers on February 23, 2015, 10:16:02 PM
okies so this is gonna be a really stupid question but the ONQUERY thing that query is a pm msg right?
Title: Re: Profile script needed
Post by: Snerf on February 24, 2015, 08:58:29 AM
Correct, a Query is just another word for a Private Message.
Title: Re: Profile script needed
Post by: Snerf on March 14, 2015, 06:32:02 PM
That is well over 100 lines of code, I sure do hope you don't expect someone to spend many hours of their free time to do that all. You would be best to learn a lot of this yourself.
Title: Re: Profile script needed
Post by: angelicwhimpers on March 15, 2015, 03:30:49 AM
sorry to have bothered you... i only asked cause i saw another post made by someone asking for a seen script and once he found an mIRC one people helped changed it over to ice chat...

thanks anyways.
Title: Re: Profile script needed
Post by: Morio on March 15, 2015, 11:49:05 AM
Some years ago I made a "seen" script for icechat when someone requested it, but I did not convert a mirc script to vbscript, I made one from scratch. That was something I did when I didn't have anything better to do, and it seemed like a nice project and challenge.

The script you are requesting is mainly just a lot of mechanical work, and at least I personally do not have time to create such a script.

We will help if you have specific questions about the script, but expecting someone to put down several hours to write a complete script for you is unrealistic.