mIRC Homepage
Posted By: Kev_Uk $decode virus ban kick - 03/11/05 01:08 PM
Few months ago i used to have a $decode virus ban/kick when someone in a channel pmed me with a $decode string, although it didn't seem to work or kick anyone, and the network i go on seems to be ridden with these at times, was wondering if someone can help me make one which would ban/kick them and in the kick message telling them why they were kicked and for help to go to another channel.
Posted By: Riamus2 Re: $decode virus ban kick - 03/11/05 02:59 PM
Try this:
Code:
on *:text:*$decode*:?: {
  if ($me isop [color:red]#yourchan[/color] && $nick ison [color:red]#yourchan[/color]) {
    ban -k [color:red]#yourchan[/color] $nick 2 Banned for $!decode trojan.  Please visit #help for assistance in removing it.
  }
  window -c $nick
}
Posted By: mIRCManiac Re: $decode virus ban kick - 03/11/05 03:12 PM
blah n/m

isin = ison
Posted By: Kelder Re: $decode virus ban kick - 03/11/05 03:49 PM
Include the ! in the ban message or $decode will just disappear smile

Banned for $!decode trojan. Please visit #help for assistance in removing it.
Posted By: Riamus2 Re: $decode virus ban kick - 03/11/05 04:37 PM
Fixed. I always end up saying isin instead of ison ... I think of being IN a channel and not ON a channel. Heh. Oops. And, I didn't think about $decode disappearing. Good catch.
Posted By: Kev_Uk Re: $decode virus ban kick - 03/11/05 05:11 PM
I'm sorry i meant to say that how to i make it ban/kick of the channels i'm opped in not really just a specific channel.
Posted By: mIRCManiac Re: $decode virus ban kick - 03/11/05 05:18 PM
Code:
on ^*:[color:red]OPEN:?[/color]:*$decode*: {
  var %i = 1
  while ($comchan($nick,%i)) {
    var %c = $ifmatch
    if [color:red]([/color]($me isop %c) [color:red]|| ($me ishop %c))[/color] .timer 1 %i ban -k %c $nick 2 Banned for $!decode trojan. Please visit #help for assistance in removing it.
    inc %i
  }
  haltdef
}


~ Edit ~
good catch
wink
Posted By: FiberOPtics Re: $decode virus ban kick - 03/11/05 05:22 PM
It might be a good idea to use the on open event instead, so that you can prevent the window from visually opening in the first place. Right now it stops the text from showing, but doesn't stop the query window from opening. Just a tip of course.
Posted By: Kev_Uk Re: $decode virus ban kick - 03/11/05 05:25 PM
If it stops the text from showing, how would i know say in future reference who i have banned and kicked, would it be too much hassle you think if it created a text file of the date and time of who was kicked, in what channel?
Posted By: FiberOPtics Re: $decode virus ban kick - 03/11/05 05:31 PM
It wouldn't be a hassle at all.

A hash table would be well suited for this. In the on open event you would do: hadd abusers $fulladdress $ctime (assuming you've already created the hash table called "abusers")

The $fulladdress serves as the hash table item which must be unique, the $ctime is the number of seconds elapsed since 1970. The good thing is you can format this value using $asctime to show it in your prefered <date> <time> combination.

Note I'm just using the $fulladdress as an example, you could use $site or their $nick or whatever will be unique and a means to identify them.

Doing a check on the hash table is easy with $hget, take a look in the help file at /help hash tables

Don't forget to open/load the table on start, and save the table on exit, or at a certain time interval using a timer.

I was going to give you the code, but I think you will greatly increase your scripting skill if you were to try to solve this yourself. The help file contains all you need to know.
Posted By: Kev_Uk Re: $decode virus ban kick - 03/11/05 05:35 PM
I personally don't know anything about hash tables and sadly wouldn't know where to start although I'm sure this would be a good and useful script for newbies and advanced users if someone was to make this script and post it somewhere on here or wherever, by the way i changed the keyword

from this:-

on ^*:OPEN:?:*$decode*: {

too on ^*:OPEN:?:*//write $decode*: {

incase i accidently kick people for pming me asking what $decode means or is.
Posted By: FiberOPtics Re: $decode virus ban kick - 03/11/05 05:39 PM
Quote:
I personally don't know anything about hash tables and sadly wouldn't know where to start


That's why you would need to type /help hash tables to learn about them, or check this small first step hash table tutorial. It doesn't cover everything about hash tables, but certainly enough to make your script. I basically already gave you the script, just not in code but in words. Anyway, if you don't want to learn about them, that's fine, I'm sure someone will whip up the code for you. I just thought this would be an excellent incentive to learn about hash tables and improve your skill a bit smile

I like this quote a lot:

Give a man a fish, you have fed him for today. Teach a man to fish, and you have fed him for a lifetime.
Posted By: Kelder Re: $decode virus ban kick - 03/11/05 05:50 PM
Only the text is halted, you should still see the kick/ban in all channels you're both in. The only people you won't notice are those that aren't in any channels you're in.
Posted By: Kev_Uk Re: $decode virus ban kick - 03/11/05 06:15 PM
I would be most grateful if someone could whip the code for me, with the hashes, at least i can learn the code when its made incase i want to make hashes of other things, i had a look at the webpage you showed me and also /help hash and couldn't really make heads or tails or it
Posted By: DaveC Re: $decode virus ban kick - 03/11/05 07:35 PM
Just a note, i think kick banning for just saying $decode is over the top, you need to be more exact, as I often see people say in a channel, someone sent me this become an op script, ans someone else well tell them to PM an OP and tell them you were sent a $decode. Its not the funniest for them to pm you to try and help and get banned for saying "joeblogs just sent me a $decode command". frown
Posted By: hixxy Re: $decode virus ban kick - 03/11/05 08:09 PM
Quote:
<user1> How can I hide my passwords?
<user2> I dunno, try using $encode and $decode
* user2 was kicked from #blah by Riamus2 "Banned for $decode trojan. Please visit #help for assistance in removing it."
Posted By: FiberOPtics Re: $decode virus ban kick - 03/11/05 08:27 PM
Don't forget that Riamus used the ? as location part, so that could never occur, unless you replaced <user1> with <Riamus2>. Although I see your point, the matching could be stricter to try to minimize the amount of false positives, however it will never be 100% certain that you don't ban people who are simply reporting a $decode() spam in pm to the user that's hosting this script.
Posted By: Riamus2 Re: $decode virus ban kick - 03/11/05 09:08 PM
Yes, I know. You can use *//write $decode(* for the matchtext if you like. I put the ( in there to help limit mistakes even further. As FiberOPtics pointed out, what I had uses ?, so it would only trigger on a PM. Still, using this other matchtext would limit false positives. I didn't bother pointing it out afterwards because it was already pointed out a couple times that it could detect false positives. It's still better to use a better matchtext than just *$decode*.
© mIRC Discussion Forums