mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2005
Posts: 1
O
Owned Offline OP
Mostly harmless
OP Offline
Mostly harmless
O
Joined: Dec 2005
Posts: 1
I have done this before, but since I havn't scripted in a while i have forgotten. I have this socks script that is a "Hey_bot" that connect to a server and says hey to people that join, only problem is people abuse it and it gets kicked.

I need either both or one of the following things:
- Script that makes it rejoin on kick
- Script that adds a delay so that when people /hop repeatively to make it say "hey ____" it only does it every 10 seconds max. (I did this before, but forgot and lost it, this would be perfered to help reduce flooding)

If someone could, please I am really grateful.

Code:
Alias Connect {
  .sockopen IRC irc.codestream.org 6667
}
on *:SOCKOPEN:IRC: {
  .sockwrite -n IRC NICK Hey_Bot
  .sockwrite -n IRC USER Hey localhost Bot :Hey Bot
  .sockwrite -n IRC msg identify Hey_bot %pass
  .sockwrite -n IRC JOIN #codestream
  .sockwrite -n IRC JOIN #hacking
  .sockwrite -n IRC JOIN #cStrike
  .sockwrite -n IRC JOIN #kaitnieks
  .sockwrite -n IRC join #aryan-n00bs
}
on *:SOCKREAD:IRC: {
  .sockread %data
  if ($gettok(%data,1,32) == ping) .sockwrite -n irc pong $gettok(%data,2,32)
}
on *:JOIN:#: {
  .sockwrite -n IRC PRIVMSG $chan :Hey $nick $+ !
  if ($nick == You) ns ghost You %pass
  else { if ($nick == Mode) ns ghost You %pass }
  else { if ($nick == Owned) ns ghost You %pass }
}
on *:TEXT:Hey:#: {
  .sockwrite -n IRC PRIVMSG $chan Hey $nick $+ ! How you doing? :)
} 


:\
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Code:
Alias Connect {
  .sockopen IRC irc.codestream.org 6667
}

on *:SOCKOPEN:IRC: {
  set %irc_chans #codestream, #hacking, #cStrike, #kaitnieks, #aryan-n00bs
[color:blue].sockwrite -n IRC NICK Hey_Bot[/color]
  .sockwrite -n IRC USER Hey localhost Bot :Hey Bots
  .sockwrite -n IRC msg identify Hey_bot %pass
  .sockwrite -n IRC JOIN %irc_chans
}

on *:SOCKREAD:IRC: {
  .sockread %data
  tokenize 32 %data
  if ($1 == ping) .sockwrite -n irc pong $2
  if ($istok(%irc_chans,$3,44)) {
    if (* KICK $3 Hey_Bot * iswm %data) sockwrite -n IRC JOIN $3
  }
}

on *:JOIN:#: {
  if (!$hget(hey_bot)) hmake hey_bot 10
  if (!$hget(hey_bot,$nick)) {
    .sockwrite -n IRC PRIVMSG $chan :Hey $nick $+ !
    hadd -cz hey_bot $nick 10
  }
  if ($nick == You) ns ghost $nick %pass
  elseif {$nick == Mode) ns ghost $nick %pass 
  elseif ($nick == Owned) ns ghost $nick %pass
}

on *:TEXT:Hey:#: {
  .sockwrite -n IRC PRIVMSG $chan Hey $nick $+ ! How you doing? :)
}


I've altered a few things. Channels are stored in a variable for future checking. Using the JOIN command you're able to join more than one channel. Changed IF statements in the On Join event.

Edit:
[*]Took out .sockwrite -n IRC NICK Hey_Bot accidently.
-Andy


Link Copied to Clipboard