mIRC Home    About    Download    Register    News    Help

Print Thread
#177463 25/05/07 01:37 PM
Joined: May 2007
Posts: 13
T
trink Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: May 2007
Posts: 13
Lately, I've been working on my own bot, for a channel that I am in, and I have been wanting it to do this:
Quote:
<nick> ? trink
<trink-bot> trink: blah blah blah

Now, via /writeini I have created a !set command that, if "!set trink blah blah blah" were used it would write the ini file as
Quote:
[trink]
key=blah blah blah

I have the ? script as follows, and it doesn't seem to work, I've tried many different ways, and this is what i've managed to get as a result, which still does not work.
Quote:
on *:TEXT:\?*:#:{
if (%tbe == 0) { }
else { if (%tbt == 0) { }
else {
/msg $chan $2 - $readini($keys.ini,$2,key)
/msg $chan %key
} } }

Don't mind the first three lines after on *:TEXT:\?*:#:{ and the ending two } }, thats code that I added in for something different, and that code seems to work.

I'm not too familiar with how to read from an ini, I orignally thought readini was an actual /command, but I was wrong, a little help would be appreciated. I'm just an irc scripting beginner. Thanks, trink.

Last edited by trink; 25/05/07 01:55 PM.
trink #177468 25/05/07 02:09 PM
Joined: May 2007
Posts: 23
C
Ameglian cow
Offline
Ameglian cow
C
Joined: May 2007
Posts: 23
Code:
on $*:TEXT:/^\? /:#:{
  if (!$istok(0,%tbe %tbt,32)) { msg # $2 - $readini($keys.ini,$2,key) }
}


should do what you want just make sure you have an alias that returns a path for $keys.ini

chiram #177471 25/05/07 02:25 PM
Joined: May 2007
Posts: 13
T
trink Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: May 2007
Posts: 13
Well, it kinda works... this is what happens:
Quote:
<trink> ? trink
<trink-bot> trink -

The INI file shows the trink key set as blah blah, but its only returning trink -, not the blah blah part, which is telling me that $readini still isnt working. :<

And as for this, I'm a bigtime irc scripting newbie, can you explain what you mean by this:
Quote:
just make sure you have an alias that returns a path for $keys.ini


Also, I've really wanted it to return trink: (without a space in between trink and : ) instead of trink -, but I gave up on that, I've been having a problem because when I tell it to return $2: it doesn't return anything there, I'm assuming because the : interferes with $2. Any help with that would be much appreciated too. smile

Last edited by trink; 25/05/07 02:38 PM.
trink #177487 25/05/07 05:32 PM
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
you calling for $keys.ini, and that needs to be returned by a alias, like:

alias keys.ini return command here


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
sparta #177489 25/05/07 05:45 PM
Joined: May 2007
Posts: 13
T
trink Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: May 2007
Posts: 13
I really know nothing about alias and all that, I'm just making a script in remote to do all this... :S
You said to put an alias script with a path for keys.ini or something like that... so what, exactly, would I do, what I'm getting out of this is I would put "alias keys.ini C:\program files\mirc\keys.ini" at the beginning of the file... Sorry, I get confused easily, can you give me a specific example of what I'd need to put? You're gonna have to bear with me here, I am the ultimate newbie, the grand newb, as it were. Yeah, it says "newbie" under my name, it should say Ultimate Newbie. =P

Last edited by trink; 25/05/07 05:50 PM.
trink #177501 26/05/07 01:27 AM
Joined: May 2007
Posts: 13
T
trink Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: May 2007
Posts: 13
nah, i got it fixed, thanks for the help anyways smile


Link Copied to Clipboard