mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2011
Posts: 10
O
Pikka bird
OP Offline
Pikka bird
O
Joined: Jan 2011
Posts: 10
Alright, so i play an online game called torncity, i'm not going to link to it, if you need to see it please google it.
Anyway, I have a basic script
http://pastebin.com/di0DmGpT
its a lottery script.
and I need a few things added to it, and i'm willing to pay 10-15$ if i'm aloud to.
anyway, i need a few simple commands.
!addid <nick> <ID>
[each user is given an ID at the start of the game that they cannot change. It's all numbers] [example: [1517715]]
anyway, I need the script to create an .ini file, thats stores the user name and ID, and reads from it later.

I need !profile <nick>
The script will then look through the .ini file and if there is a nick in there it will state back the link to their profile
http://www.torn.com/profiles.php?XID= <ID>
[example:http://www.torn.com/profiles.php?XID=1517715]

So when someone types
user: !profile oursickstory
the bot will reply with
bot: profile for oursickstoy - http://www.torn.com/profiles.php?XID=1517715

or something of the sort.

last but not lest, the lotto.
I need the lotto to not let people join unless their ID is in the INI file. so if they don't have their id added it would say
'please add your ID using !addid <nick> <ID> before joining the lotto'

Thanks in advance.
If you need me please email me oursickstoryydg@gmail.com
like I said, i wouldn't mind paying for this, it shouldn't take more then 15-20 minutes.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Adding the ID and linking the profile is very easy-

Code:
on *:text:*:#: {
  if ($1 == !addid) {
    if (!$2 || $3 || $2 !isnum) { msg $chan Usage: !addid nick ID | return }
    writeini id.ini IDs $2 $3
  }
  elseif ($1 == !profile) {
    if (!$2 || $3) { msg $chan Usage: !profile nick | return }
    if ($readini(IDs, $2)) { msg $chan profile for oursickstoy - http://www.torn.com/profiles.php?XID= $+ $v1 }
    else { msg $chan Please add your ID using !addid nick ID }
  }
}


Insert this into your on text event you're already using. I put it in its own event just to show how it fits, but ignore the first at last lines here and just insert it into your current on text event.


I'll have to help with anything else later as I'm about to leave work. Or someone else can help in the meantime.

Last edited by Riamus2; 19/01/11 09:10 PM.

Invision Support
#Invision on irc.irchighway.net
Joined: Jan 2011
Posts: 10
O
Pikka bird
OP Offline
Pikka bird
O
Joined: Jan 2011
Posts: 10
i appreciate it thank you.
i was thinking something along the lines of
writeini ids.ini IDS $nick 1440500500505050
no?
But maybe a txt instead? which would work better?


Link Copied to Clipboard