mIRC Home    About    Download    Register    News    Help

Print Thread
#131559 01/10/05 02:37 PM
Joined: Sep 2005
Posts: 5
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Sep 2005
Posts: 5
Hiya all. I really have no idea how to go about this so I need someones who's clued with this stuff to help.
I'd like a simple server bot, that dose the following
- Whois
- Gag
- Kill
- Kill & Ban (2O mins)
(The Bot would have admin status)

Examples: (when someones dose the following commands)

WHOIS
/msg <botname> whois test
Bot Message reply (whispers back the whois)
<botname> test!~test@theweb.com

GAG
/msg <botname> gag nickname
Bot Message reply (whispers back)
<botname> nickname gagged

UNGAG
/msg <botname> ungag nickname
Bot Message reply (whispers back)
<botname> nickname ungagged

KILL
/msg <botname> kill nickname
Bot Message reply (whispers back)
<botname> nickname killed

BAN
/msg <botname> ban nickname
Bot Message reply (whispers back)
<botname> nickname killed & banned for 20 minutes

I haven't seen anything like this yet, so I don't know wether it's possible. Any help would be much appreciated.

#131560 01/10/05 07:39 PM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
heres simple scripts

on ^1:TEXT:*:?: {
if $1 == gag { gag $2 | halt }
if $1 == ungag { ungag $2 | halt }
if $1 == kill { kill $2 $?="reason:" | halt }
if $1 == ban { ban $2 $3 | halt }
}

ban functions when you msg ban to your bot do /msg botname ban channel nickname to do a successfull ban

bascially you get the point.. when you emssage your bot the first word that you say to it ex:. gag it performs the command gag and the reason for $2 is the second word so example /msg bot gag testperson

all whois functions you have etc... can be implemented into that...


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#131561 01/10/05 08:52 PM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
Code:
on ^1:TEXT:*:?: {
  ; /msg botnick gag nick-to-gag
  if ($1 == gag) &amp;&amp; ($2) {
    .gag $2
    .msg $nick $2 gagged
  }
  ; /msg botnick ungag nick-to-ungag
  elseif ($1 == ungag) &amp;&amp; ($2) {
    .ungag $2
    .msg $nick $2 un-gagged
  }
  ; /msg botnick kill nick reason
  elseif ($1 == kill) &amp;&amp; ($3) {
    .kill $2 $3-
    .msg $nick $2 killed, reason: $3-
  }
  ; /msg botnick ban nick reason
  else ($1 == ban) &amp;&amp; ($3) {
    ; place the relevant Xline code here
    .msg $nick $2 killed and banned for 20 minutes, reason: $3-
  }
  halt
}

There is no need to misuse halt like that, and its a good idea to check that the needed info is there. Not sure if the kill and ban commands are correct, not sure if you mean network kill and 20 min network Xline, or if you mean channel kick and channel kick/ban for 20 min.

As for the whois stuff, its not as simple as just shoving another command in the code, you have to capture the raws to get the information. You can look in the following thread for an example of how to do this...

https://forums.mirc.com/showflat.php?Cat=0&Number=137861&an=0&page=1

Last edited by Om3n; 01/10/05 09:00 PM.

"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
#131562 01/10/05 09:33 PM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
yeah i suppose can be done like that but i believe not 100% sure though i assume he asked for a simple script i could of gone into detail like for a complete whois (**EXCLUDING***) raw event for the whois that describes your host/ip

Code:
on ^1:TEXT:*:?: {
%whois.nick = $chan
if ($1 == whois) { 
whois $2 
}
}

RAW 311:*: {
  msg %whois.nick $2-
}
RAW 307:*: {
  msg %whois.nick $2-
}
RAW 319:*: {
  msg %whois.nick $2-
}
RAW 312:*: {
  msg %whois.nick $2-
}
RAW 313:*: {
  msg %whois.nick $2-
}
RAW 310:*: {
  msg %whois.nick $2-
}
RAW 320:*: {
  msg %whois.nick $2-
}
RAW 318:*: {
  msg %whois.nick $2-
}



smile lol i know where ya coming from omen but jeez dude give me a pace or 2 just trying to keep the scripting alive is all


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#131563 02/10/05 08:27 AM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
If ALL that is needed is the hostmask, they could just use the /who raw instead, quicker than whois and less sever load. There is no way to get this information for a nickname you do not share a common channel with other than by requesting it from the server with commands such as whois, whowas and who.

ps, was just pointing out that all the halts were not neccersary, nothing more.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
#131564 03/10/05 10:02 AM
Joined: Sep 2005
Posts: 5
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Sep 2005
Posts: 5
Okay thanks smile


Link Copied to Clipboard