mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
1. I was going to make scripts like when I say "!id bot" from one name, then my bot would id with ns...
and make it so only I could tell it that command...
I have no clue how I would do that.


2. How do you get it to reply to a command in multiple lines..
like when you type "!count" it would reply with "1" then "2" then "3"..

Last edited by blk; 08/02/06 03:27 AM.

-blk-
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
1)
Code:
on *:text:!id bot:*:{ .ns identify <password> } 

2)
Code:
on *:text:!count*:#:{
if !$2 {
 .msg $nick Format is !count <high number> <interval>
.msg $nick <interval> will default to 1 if not supplied
}
var %rpt = $calc($2 / $iif(!$3,1,$3))
if $abs(%rpt) != %rpt {
.msg $nick Sorry, but I'll never reach $2 using increments of $iif(!$3,1,$3)
}
else {
var %count = 1
while %count <= $2 {
describe $chan %count
inc $iif(!$3,1,$3)
}
}
}
 


I added a few simple features to the second code to keep it from looping indefinetly.

Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
I guess 1 was pretty simple, just need to think about it...
Is there anyway I can get it just to respond from a specific nick?


-blk-
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
between the ON TEXT event and the other commands add
Code:
if ($nick == <nick>) {  
and at the end of the code put in an extra }

Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
I dont think 2 works... I forgot about it... tryed it today and got nothing...


-blk-
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Small error on my part. Here's the corrected code with the nick requirement.
Code:
 on *:text:!count*:#:{
  if ($nick == <nick>) {
    if !$2 {
      .msg $nick Format is !count <high number> <interval>
      .msg $nick <interval> will default to 1 if not supplied
    }
    var %rpt = $calc($2 / $iif(!$3,1,$3))
    if $abs(%rpt) != %rpt {
      .msg $nick Sorry, but I'll never reach $2 using increments of $iif(!$3,1,$3)
    }
    else {
      var %count = 1
      while %count <= $2 {
        describe $chan %count
        inc %count $iif(!$3,1,$3)
      }
    }
  }
}
 


Replace <nick> with the appropriate nick


Link Copied to Clipboard