mIRC Home    About    Download    Register    News    Help

Print Thread
#115748 29/03/05 06:13 PM
Joined: Mar 2005
Posts: 9
M
milKeR Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Mar 2005
Posts: 9
on *:text:!rules:#channel: {
set % [ $+ [ $+($nick,RULES) ] ] 1
dcc chat $nick
}
on *:open:=: {
if (% [ $+ [ $+($nick,RULES) ] ]) {
unset % [ $+ [ $+($nick,RULES ] ]
play =$nick rules.txt 0
}
}

This script gonna send a txt file.. in this case rules.txt to the person that types !rules on my channel..

But it does'nt work.. Why??


The person that types !rules gets this lines from the bot:
----------------------------------------------------
DCC Chat session
-
Client: TESTBOT (81.181.86.253)
Time: Thu Mar 24 17:44:51 2005
-
Acknowledging chat request...
DCC Chat connection established
-
----------------------------------------------------


The "bots": message:
----------------------------------------------------
Chat with TEST
Waiting for acknowledgement...
DCC Chat connection established
-

#115749 29/03/05 09:51 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
If you're wanting to send the file rules.txt from the bot to the person, use
Code:
on *:text:!rules:#:{ .dcc send -c $nick rules.txt } 


On the other hand, if you just want the rules to be shown to the person, rather than sending them the file, use
Code:
on *:text:!rules:#:{ .play $nick rules.txt 2000 }  


I use the above codes on my own bot

Last edited by RusselB; 29/03/05 10:40 PM.
#115750 29/03/05 10:09 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Code:
on *:open:=: {
  echo -st ON OPEN = CHECK POINT $!nick = $nick
  if ( % [ $+ [ $+($nick,RULES) ] ] ) {
    unset % [ $+ [ $+($nick,RULES ] ]
    play =$nick rules.txt 0
  }
}


Try that, its designed to do two things, one it checks on what $nick equals, and two i spaced out the [ ] sometimes there touchy about things touching them

If it works remove the echo line, if not then check is $nick is comming back with the = already attached, if it is use $mid($nick,2) example below....
Code:
on *:open:=: {
  if ( % [ $+ [ $+($mid($nick,2),RULES) ] ] ) {
    unset % [ $+ [ $+($mid($nick,2),RULES ] ]
    play $nick rules.txt 0
  }
}


PS: the other examples shown in this thread well work as well, I just looked at your code only for what might be wrong.


Link Copied to Clipboard