mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2005
Posts: 2
sMatis Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
Joined: Feb 2005
Posts: 2
Is there any $awaymsg variable to check users for an away msg ... for example we have a lot of spammers on our irc network and spam bots advertising links or channels in away msg ... so i want to make some addon: on $Nick joins channel and if $me isop $chan .... && $away is damn spam bot get it from www.lamer.org .... mode $chan +b $nick kick $chan $nick Damn you! .... hmmmm ... how to do that ?

Last edited by sMatis; 20/02/05 12:27 PM.
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Code:
#away off
Raw 301:*: { 
  if (Change me.. isin $1-) { 
    mode %away.chan +b %away.nick
    kick %away.chan %away.nick Damn you! 
  }
  .disable #away
}
#away end

on @*:Join:#: {
  .whois $nick
  .enable #away
  set %away.chan $chan
  set %away.nick $nick
}


This is where we check if Change me.. isin the away msg. I don't believe $awaymsg is used in these events as it is a Raw event. We deal with Raw messages with $N-. Alternatively, we could use $Rawmsg.

Joined: Feb 2005
Posts: 2
sMatis Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
Joined: Feb 2005
Posts: 2
wow ! thanks man ! :-) is it possible to write in Change me a text's file name I mean that command will read all possible spam-away messages from txt file ?


-= sMatis =-
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Ok, this sort of does what you want. You type in the awaymsg's you wan't banned. It has to be a complete match though. No isin's.

Lets say you added "I am a spam". And their true awaymsg is " am a spam bot", they wont get banned. You'd need to have their actual awaymsg. So, you need to add "I am a spam bot". For that to work.

Other than that it should work fine, you can add 1,000 items to your hash table (database) type thing so if your network is that badly spammed then I expect to see that 1,000 items filled up by the end of the day hehehe. wink

Right click in channels to open your dialog. If you need anymore help come back ask me or anyone else. grin


Code:
menu channel {
  $iif($dialog(awaymsg),$style(7)) Away Msg: { 
    .dialog -dm awaymsg awaymsg
  }
}

on 1:Start: {  
  hmake awaymsg 1000 
  if ($isfile(awaymsg.hsh)) {   
    hload -o awaymsg awaymsg.hsh 
  }
}

dialog awaymsg {
  title "Away...."
  size -1 -1 76 150
  option dbu
  combo 1, 3 3 70 98, size
  button "Add", 4, 16 113 22 12
  button "Del", 5, 39 113 22 12
  button "Close", 8, 22 130 37 12
}

alias awaymsg2 {
  if (($hget(awaymsg) && $hget(awaymsg,0).item) > 0) { 
    var %awaymsg = $hget(awaymsg,0).item
    while (%awaymsg) {
      if ($hget(awaymsg,%awaymsg).data == $3-) { 
        mode %away.chan +b %away.nick
        kick %away.chan %away.nick Damn you! 
      }
      dec %awaymsg
    }
  }
  elseif (($hget(awaymsg) && !$hget(awaymsg,0).item)) {  return }
}

alias awaymsg {
  if (($hget(awaymsg) && $hget(awaymsg,0).item) > 0) { 
    var %awaymsg = $hget(awaymsg,0).item
    while (%awaymsg) {
      if ($dialog(awaymsg)) {
        did -a awaymsg 1 $hget(awaymsg,%awaymsg).data
        dec %awaymsg
      }
    }
  }
  elseif (($hget(awaymsg) && !$hget(awaymsg,0).item)) {  return }
}

on 1:dialog:awaymsg:init:0: {
  did -b awaymsg 5
  awaymsg
}

on 1:dialog:awaymsg:sclick:1: {
  if ($did(awaymsg,1).sel) { 
    did -e awaymsg 5
  }
}

on 1:dialog:awaymsg:sclick:2: {
  if ($did(awaymsg,2).sel) { 
    did -e awaymsg 7
  }
}

on 1:dialog:awaymsg:sclick:4: {
  if ($hget(awaymsg)) {
    if ($did($dname,1).text) {
      did -a awaymsg 1 $did($dname,1).text
      hadd awaymsg $didwm(awaymsg, 1,$did(awaymsg,1).text) $did($dname,1).text
    }
  }
}

on 1:dialog:awaymsg:sclick:5: {
  if ($did($dname,1).sel) {
    if ($hget(awaymsg)) {
      hdel awaymsg $didwm(awaymsg, 1,$did(awaymsg,1).seltext)
      did -d awaymsg 1 $didwm(awaymsg, 1,$did(awaymsg,1).seltext)
      did -b awaymsg 5 
    }
  }
}

on 1:dialog:awaymsg:sclick:8: {
  dialog -x awaymsg awaymsg
}

on 1:dialog:awaymsg:close:0: {
  hsave -o awaymsg awaymsg.hsh
}

#away off
Raw 301:*: {
  awaymsg2 $1-
  .disable #away
}
#away end

on @*:Join:#: {
  .whois $nick
  .enable #away
  set %away.chan $chan
  set %away.nick $nick
}

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Quote:
Other than that it should work fine, you can add 1,000 items to your hash table (database) type thing so if your network is that badly spammed then I expect to see that 1,000 items filled up by the end of the day hehehe.


Actually when you set the slot size 1000 it means the hash table is prepared for around 10000 items, but you can put virtually an unlimited amount of items, no matter what you chose for slot size, as long as your ram allows for it. The N actually stands for the number of containers (buckets) as they are called commonly. If you're interested to find out more about hash tables you could check out these links: 1 2 or look it up on google.


Gone.
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Learn something new every day. grin


Link Copied to Clipboard