Jump to content

chain

Administrators
  • Posts

    5,964
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by chain

  1. OMG A real old classic Memory this site is eXyonte's Realm
  2. Might need updating as is old shoutcast1.02.txt
  3. Welcome to GoodChatting.com, home of the GoodChatting.com IRC network! GoodChatting is a single-server IRC network, running UnrealIRCd and Epona services. This server is owned by Julie Martin ("juliebug") and was created as a private alternative to the Undernet IRC network when it underwent severe denial of service attacks in early 2001. GoodChatting has been running since February of 2001 and has been open to the public since September 25th, 2001. The goal here is to provide a place for you to have a good chatting experience. We here at GoodChatting want you to feel at home on our small server, which already hosts a ton of chatters mostly related to National Novel Writing Month and other writing adventures. We are not looking to join any networks, nor are we looking to add servers to the GoodChatting network at this time. Any and all server updates can be found on the Server News page as well as on Twitter, just follow @goodchatting! link here
  4. Chapter 1. Connecting to IRC Introduction: Hacks #1-4 One of the great features about IRC is its accessibility. You can connect to any IRC network using an IRC client (read: application). For many users, the IRC client is the friendly face of IRC, allowing you to chat with individuals or groups of users. IRC clients are available for virtually all operating systems. In fact, several different IRC clients are available for Windows, Linux, and Mac OS X, so you are spoiled for choice if you have time to experiment with all available choices. This chapter will show you how to use some of the most popular IRC clients to connect to IRC. Later hacks will then show you how to go beyond the basics and enhance the functionality of some of these IRC clients by exploiting existing features and writing your own IRC client scripts. Read more here
  5. Hundreds of thousands of Twitter users deactivated their accounts in the days after Elon Musk’s takeover deal, the company says, as prominent users including Katy Perry and Barack Obama lost followers. Since Monday, some of the social network’s biggest progressive voices have seen their public follower counts decline, while some rightwing Twitter users have gained followers, according to data from the analytics site Social Blade. Perry, the pop star who is the site’s third biggest user, lost 7,000 followers in a few days, while Obama, whose 132 million followers makes the former US president’s account the most popular on the site, lost 5,000 on Tuesday alone. Followers of the former first lady, Michelle Obama, are down by nearly 20,000. Taylor Swift’s Twitter account also had one of the biggest drops according to Social Blade’s data, losing 15,000 followers in 48 hours. Read More Here
  6. Netflix surprised the world this week, saying it plans to finally address the rampant practice of password sharing. More than 100 million households are using a shared password, Netflix said Tuesday, including 30 million in the U.S. and Canada. But the video streamer doesn’t plan to simply freeze those shared accounts. Instead, the company will likely favor the setting of an extra fee for those accounts being used by multiple people outside of the home. Netflix’s plan to capture that lost revenue would start with an alert being sent to account holders whose passwords are being used by other households. The company has already started a test of this feature in Peru, Costa Rica and Chile. For accounts that are sharing a password across addresses, Netflix is charging an additional fee to add “sub accounts” for up to two people outside the home. The pricing is different per country — about $2.13 per month in Peru, $2.99 in Costa Rica, and $2.92 in Chile, based on current exchange rates. Read More Here
  7. chain

    OO7.tcl

    I recommend you don't run this script on a bot that already has to do alot If the channel you're spying on has alot of users with alot of talking your bot could excess flood # Info # Author : AkTaRuS - #SiamoSoloNoi on IRCserveR Italia https://www.ircwebnet.com/chat # Version: 007.TCL 1.1 set spy(author) "AkTaRuS - #SiamoSoloNoi on IRCserveR Italia https://www.ircwebnet.com/chat" set spy(version) " OO7.tcl 1.1" # Description # This script will relay anything said on one channel to the other channel you configure # I recommend you don't run this script on a bot that already has to do alot # If the channel you're spying on has alot of users with alot of talking your bot could excess flood # Configuration # The channel it reports everything to set spy(home) "#siamosolonoi" # The channel it gets all the data from and then reports it to the homechannel set spy(chan) "#canale spiato" bind PUBM -|- * spychan:chat bind CTCP -|- "ACTION" spychan:action bind SIGN -|- "$spy(chan) *" spychan:sign bind JOIN -|- "$spy(chan) *" spychan:join bind PART -|- "$spy(chan) *" spychan:part bind SPLT -|- "$spy(chan) *" spychan:split bind KICK -|- "$spy(chan) *" spychan:kick bind RAW * "MODE" spychan:mode proc spychan:part { nickname hostname handle channel reason } { global spy if {[string equal -nocase $channel $spy(chan)]} { putserv "PRIVMSG $spy(home) :\[$channel\] * $nickname ($hostname) has left $spy(chan)" } } proc spychan:join { nickname hostname handle channel } { global spy if {[string equal -nocase $channel $spy(chan)]} { putserv "PRIVMSG $spy(home) :\[$channel\] * $nickname ($hostname) has joined $spy(chan)" } } proc spychan:kick { nickname hostname handle channel target reason } { global spy if {[string equal -nocase $channel $spy(chan)]} { putserv "PRIVMSG $spy(home) :\[$channel\] * $target was kicked from $spy(chan) by $nickname ($reason)" } } proc spychan:mode { from key arguments } { global spy set channel [string trim [lindex [split $arguments] 0]] set modechange [string trim [lindex [split $arguments] 1]] set victims [string trim [join [lrange [split $arguments] 2 end]]] set nickname [string trim [lindex [split $from "!"] 0]] set hostname [string trim [lindex [split $from "!"] 1]] if {[string equal -nocase $channel $spy(chan)]} { putserv "PRIVMSG $spy(home) :\[$channel\] * $nickname sets mode: $modechange $victims" } } proc spychan:sign { nickname hostname handle channel reason } { global spy if {[string equal -nocase $channel $spy(chan)]} { putserv "PRIVMSG $spy(home) :\[$channel\] * $nickname ($hostname) has quit IRC ($reason)" } } proc spychan:split { nickname hostname handle channel arguments } { global spy if {[string equal -nocase $channel $spy(chan)]} { putserv "PRIVMSG $spy(home) :\[$channel\] * $nickname has split from the network" } } proc spychan:chat { nickname hostname handle channel arguments } { global spy if {[string equal -nocase $channel $spy(chan)]} { putserv "PRIVMSG $spy(home) :$arguments" } } proc spychan:action { nickname hostname handle channel keyword arguments } { global spy if {[string equal -nocase $channel $spy(chan)]} { putserv "PRIVMSG $spy(home) :\[$channel\] * $nickname $arguments" } } putlog "OO7.tcl version $spy(version) by $spy(author) Loaded!"
  8. # +-------------------------------------------------------------------------------------+ # | | # | YouTUBE Script v2.0.0 | # | | # +-------------------------------------------------------------------------------------+ # | | # | *** Website @ http://www.EggdropTCL.com | # | *** GitHub @ http://github.com/MadaliNTCL/eggdrop-tcl | # | | # +-------------------------------------------------------------------------------------+ # | *** IRC Support: | # | #EggdropTCL @ QuakeNET | # | #EggdropTCL @ UnderNET | # | #EggdropTCL @ EfNET | # | | # | *** Contact: | # | Yahoo Messenger/Mail: madalinmen28@yahoo.com | # | Google Mail : madalinmen28@gmail.com | # | Skype Messenger : madalinmen28 | # | | # +-------------------------------------------------------------------------------------+ # + *** Commands *** | # | +---------------+ | # | [ OP - PUBLIC] | # | +---------------+ | # | | # | +++ !youtube on | # | +++ !youtube off | # | | # | IMPORTANT: | # | | # | 500 requests per day | # | You need Google Api Key | # | | # | Updates: | # | * v2 | # | -- It now catches the youtube link from /me and /ame | # +-------------------------------------------------------------------------------------+ bind PUBM - * youtube bind PUBM - * youtube:pubm bind CTCP - ACTION youtube:act package require json package require http package require tls set youtube(api) "youtube api key" set youtube(version) "2.0" setudef flag youtube proc youtube:pubm {nick uhost hand chan arg} { global temp if {[string index $arg 0] in {! . `}} { set temp(cmd) [string range $arg 1 end] set temp(cmd) [lindex [split $temp(cmd)] 0] set arg [join [lrange [split $arg] 1 end]] } elseif {[isbotnick [lindex [split $arg] 0]]} { set temp(cmd) [lindex [split $arg] 1] set arg [join [lrange [split $arg] 2 end]] } else { return 0 } if {[info commands ytpubm:$temp(cmd)] ne ""} { ytpubm:$temp(cmd) $nick $uhost $hand $chan $arg } } proc ytpubm:youtube {nick uhost hand chan arg} { global youtube tempYT switch -exact -- [lindex [split $arg] 0] { on { if {[isop $nick $chan] || [matchattr $hand n]} { channel set $chan +youtube putserv "PRIVMSG $chan :\002$nick\002 - \00302Set channel mode \00306+youtube\0032 on \00304$chan" return } } off { if {[isop $nick $chan] || [matchattr $hand n]} { channel set $chan -youtube putserv "PRIVMSG $chan :\002$nick\002 - \00302Set channel mode \00306-youtube\0032 on \00304$chan" return } } top {} search { ::http::register https 443 [list ::tls::socket -tls1 1] if {[catch {http::geturl "https://www.googleapis.com/youtube/v3/videos?[http::formatQuery key $youtube(api) maxresults 5 part id,snippet type video order viewCount q [lindex [split $arg] 1]]"} tok]} { putlog "Socket error: $tok" return 0 } if {[http::status $tok] ne "ok"} { set status [http::status $tok] putlog "TCP error: $status" return 0 } if {[http::ncode $tok] != 200} { set code [http::code $tok] http::cleanup $tok putlog "HTTP Error: $code" return 0 } set data [http::data $tok] set parse [::json::json2dict $data] set tempYT(video1) "[lindex [dict get [lindex [dict get $parse items] 0] id] 3] [lindex [dict get [lindex [dict get $parse items] 0] snippet] 5]" set tempYT(video2) "[lindex [dict get [lindex [dict get $parse items] 1] id] 3] [lindex [dict get [lindex [dict get $parse items] 1] snippet] 5]" set tempYT(video3) "[lindex [dict get [lindex [dict get $parse items] 2] id] 3] [lindex [dict get [lindex [dict get $parse items] 2] snippet] 5]" set tempYT(video4) "[lindex [dict get [lindex [dict get $parse items] 3] id] 3] [lindex [dict get [lindex [dict get $parse items] 3] snippet] 5]" set tempYT(video5) "[lindex [dict get [lindex [dict get $parse items] 4] id] 3] [lindex [dict get [lindex [dict get $parse items] 4] snippet] 5]" putserv "PRIVMSG $chan :\002\00301,00You\00300,04Tube\002\017 - \00304Top 5\00302 videos based on \00303viewCount\003" set number 0 foreach line [array names tempYT] { if {[llength $line]} { incr number set id "[lindex $tempYT($line) 0]" set title "[join [lrange $tempYT($line) 1 end]]" putserv "PRIVMSG $chan :$number. \00302Title - \00312$title\003 \037\002/\037\002 \00302Link\003: \00304https://www.youtube.com/watch?v=$id" } } } } } proc youtube:act {nick uhost hand dest key arg} { global ytignore youtube if {![channel get $dest youtube]} { return 0 } if {![string match -nocase *yout* $arg]} { return 0 } ## ++ set floodtime 10 ## ++ if {![info exists ytignore($nick)]} { set ytignore($nick) [unixtime] utimer $floodtime [list unset -nocomplain ytignore($nick)] } ## ++ if {[expr [unixtime]-$ytignore($nick)]>$floodtime} { putlog "ignoram"; return 0 } set youtubecheck [regexp -all -nocase {(?:\/watch\?v=|youtu\.be\/)([\d\w-]{11})} $arg match youtubeid] youtube:parse $youtubecheck $match $youtubeid $dest } proc youtube {nick uhost hand chan arg} { global ytignore youtube if {![channel get $chan youtube]} { return 0 } if {![string match -nocase *yout* $arg]} { return 0 } ## ++ set floodtime 10 ## ++ if {![info exists ytignore($nick)]} { set ytignore($nick) [unixtime] utimer $floodtime [list unset -nocomplain ytignore($nick)] } ## ++ if {[expr [unixtime]-$ytignore($nick)]>$floodtime} { putlog "ignoram"; return 0 } set youtubecheck [regexp -all -nocase {(?:\/watch\?v=|youtu\.be\/)([\d\w-]{11})} $arg match youtubeid] youtube:parse $youtubecheck $match $youtubeid $chan } proc youtube:parse {youtubecheck match youtubeid dest} { global ytignore youtube ::http::register https 443 [list ::tls::socket -tls1 1] if {[catch {http::geturl "https://www.googleapis.com/youtube/v3/videos?[http::formatQuery id $youtubeid key $youtube(api) part snippet,contentDetails,statistics,status]"} tok]} { putlog "Socket error: $tok" return 0 } if {[http::status $tok] ne "ok"} { set status [http::status $tok] putlog "TCP error: $status" return 0 } if {[http::ncode $tok] != 200} { set code [http::code $tok] http::cleanup $tok putlog "HTTP Error: $code" return 0 } set data [http::data $tok] set parse [::json::json2dict $data] set playtime [lindex [dict get [lindex [dict get $parse items] 0] snippet] 1] set title [lindex [dict get [lindex [dict get $parse items] 0] snippet] 5] set viewCount [lindex [dict get [lindex [dict get $parse items] 0] statistics] 1] set likeCount [lindex [dict get [lindex [dict get $parse items] 0] statistics] 3] set dislikeCount [lindex [dict get [lindex [dict get $parse items] 0] statistics] 5] set commentCount [lindex [dict get [lindex [dict get $parse items] 0] statistics] 9] set publishedAt [lindex [dict get [lindex [dict get $parse items] 0] snippet] 1] set publishedAt [string map [list "T" " " ".000Z" ""] $publishedAt] set channelTitle [lindex [dict get [lindex [dict get $parse items] 0] snippet] 11] set duration [lindex [dict get [lindex [dict get $parse items] 0] contentDetails] 1] set duration [string map [list "PT" "" "M" "m " "S" "s"] $duration] set definition [string toupper [lindex [dict get [lindex [dict get $parse items] 0] contentDetails] 5]] putserv "PRIVMSG $dest :\002\00301,00You\00300,04Tube\002\017 \00312$title\003 \002\00304$definition\003\002 \037\002/\002\037 \00302Views\003: \00303[youtube:convert $viewCount]\003 \037\002/\002\037 \00302Likes\003: \00310[youtube:convert $likeCount]\003 \037\002/\002\037 \00302Dislikes\003: \00304[youtube:convert $dislikeCount]\003 \037\002/\002\037 \00302Comments\003: \00304[youtube:convert $commentCount]\003 \037\002/\002\037 \00302Duration: \00304$duration\003 \037\002/\002\037 \00302Published at: \00304$publishedAt\003 by \00312$channelTitle" } proc youtube:convert {num} { while {[regsub {^([-+]?\d+)(\d\d\d)} $num "\\1.\\2" num]} {}; return $num } putlog "++ \[ - \00304PUBLIC\003 - \00306loaded\003 * \00303YouTUBE\003 \]"
  9. useful tcl that can help you enable your eggdrop scripts chanset.tcl
  10. TCL that uses the "sendmail" command from linux to send emails. Command: !mail <email@myemail> <subject> <text> [use ~ between lines to send multiple lines] -- must have "sendmail" installed -- sendmail.tcl
  11. Check your compatibility with other users with this fun script. compatibility.tcl
  12. Join Counter for users (counts unique joins per day) joincount.tcl
  13. Bans users onjoin that reply with specific CTCP version or dont respond to VERSION at all. badversion.tcl
  14. set myTriga "!" bind pub - ${myTriga}puff puff:pub proc puff:pub {nick uhost hand chan arg} { global botnick if {[validuser [nick2hand $nick]]} { if {[lindex [split $arg] 0] == ""} { putserv "PRIVMSG $chan :\001ACTION \0033hands $nick a Bag of \0039,3*WeeD*\003\001" putserv "PRIVMSG $chan :\001ACTION \00314( *puff - puff* )\003\001" } else { set givenick [lindex [split $arg] 0] if {[isbotnick $givenick]} {putquick "PRIVMSG $chan :umm, bots don't sm0ke, you f00l!"; return} putserv "PRIVMSG $chan :\001ACTION \0033was asked nicely by $nick to give $givenick a Bag of \0039,3*WeeD*\003\001" putserv "PRIVMSG $chan :\001ACTION \00314( *puff - puff* )\003\001" } return } if {![validuser [nick2hand $nick]]} { if {[lindex [split $arg] 0] == ""} { putserv "PRIVMSG $chan :\001ACTION \0033hands $nick a Bag of \0039,3*WeeD*\003\001" putserv "PRIVMSG $chan :\001ACTION \00314( *puff - puff* )\003\001" set whom $nick set ignoremask *!*@[lindex [split [getchanhost $whom $chan] @] 1] newignore $ignoremask $botnick TempIgnore 1 } else { set givenick [lindex [split $arg] 0] if {[isbotnick $givenick]} {putquick "PRIVMSG $chan :umm, bots don't sm0ke, you f00l!"; return} putserv "PRIVMSG $chan :\001ACTION \0033was asked nicely by $nick to give $givenick a Bag of \0039,3*WeeD*\003\001" putserv "PRIVMSG $chan :\001ACTION \00314( *puff - puff* )\003\001" set whom $nick set ignoremask *!*@[lindex [split [getchanhost $whom $chan] @] 1] newignore $ignoremask $botnick TempIgnore 1 } return } }
  15. set pubtrig "!" # Set global|channel flags to trigger commands set sysflags o|m bind pub - ${pubtrig}uptime uptime:pub proc uptime:pub {nick uhost hand chan arg} { global uptime server sysflags if {([matchattr [nick2hand $nick] $sysflags]) && (![regexp c [getchanmode $chan]])} { puthelp "PRIVMSG $chan :\002S\002\037ystem\037: [eval exec uptime]" puthelp "PRIVMSG $chan :\002B\002\037ot\037 ($server): [duration [expr [unixtime] - $uptime]]" } else { if {([matchattr [nick2hand $nick] $sysflags]) && ([regexp c [getchanmode $chan]])} { puthelp "PRIVMSG $chan :System: [eval exec uptime]" puthelp "PRIVMSG $chan :Bot ($server): [duration [expr [unixtime] - $uptime]]" } } } bind pub - ${pubtrig}os osystem:pub proc osystem:pub {nick uhost hand chan arg} { global botnick sysflags if {([matchattr [nick2hand $nick] $sysflags]) && (![regexp c [getchanmode $chan]])} { puthelp "PRIVMSG $chan :\002O\002\037perating\037 \002S\002\037ystem\037: [eval exec uname] [eval exec uname -r]" } else { if {([matchattr [nick2hand $nick] $sysflags]) && ([regexp c [getchanmode $chan]])} { puthelp "PRIVMSG $chan :Operating System: [eval exec uname] [eval exec uname -r]" } } }
  16. # $Id: autoreply.tcl,v1.7 18/01/2016 03:33:45am GMT +13 (NZDST) IRCSpeed Exp $ # Commands are; !talkz on|off # /msg botnick talkz #channel on|off # Feel free to edit the trigger, the reply flags and thankstext/complaintext. Add heaps of replies, or have a few, it's up to you. # Feel free to edit this setting. Change the ! to any character you would like as a trigger. set replytrig "!" # Set here what flags you wish to allow and trigger this script (leave it "" for anyone) set replyflags "ovf|ovf" # Set here the text to thank the user who voiced you. set thankstext { "Thanks for the $mode $nick" "wow.. thanks, $nick" "cool, thank you! I _LOVE_ $chan!!" } # Set here the text to complain about being devoiced. set complaintext { "awww, man! why me, $nick?!" "pfft, be that way, /hop" "wait until I tell .." "hmm, stop it." } ########## ----- NO EDITING BELOW ----- ########## proc getReplyTrig {} { global replytrig return $replytrig } setudef flag talkz bind mode - "% +o" op:check bind mode - "% -o" deop:check bind mode - "% +v" voice:check bind mode - "% -v" devoice:check bind pub - ${replytrig}talkz talkz:pub bind msg - talkz talkz:msg proc talkz:pub {nick uhost hand chan arg} { global replyflags if {[matchattr [nick2hand $nick] $replyflags $chan]} { if {[lindex [split $arg] 0] == ""} {putquick "PRIVMSG $chan :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [getReplyTrig]talkz on|off"; return} if {[lindex [split $arg] 0] == "on"} { if {[channel get $chan talkz]} {putquick "PRIVMSG $chan :\037ERROR\037: This setting is already enabled."; return} channel set $chan +talkz puthelp "PRIVMSG $chan :Enabled Autoreply Thanks System for $chan" return 0 } if {[lindex [split $arg] 0] == "off"} { if {![channel get $chan talkz]} {putquick "PRIVMSG $chan :\037ERROR\037: This setting is already disabled."; return} channel set $chan -talkz puthelp "PRIVMSG $chan :Disabled Autoreply Thanks System for $chan" return 0 } } } proc talkz:msg {nick uhost hand arg} { global botnick replyflags set chan [strlwr [lindex [split $arg] 0]] if {[matchattr [nick2hand $nick] $replyflags $chan]} { if {[lindex [split $arg] 0] == ""} {putquick "NOTICE $nick :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: /msg $botnick talkz #channel on|off"; return} if {[lindex [split $arg] 1] == ""} {putquick "NOTICE $nick :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: /msg $botnick talkz $chan on|off"; return} if {[lindex [split $arg] 1] == "on"} { if {[channel get $chan talkz]} {putquick "NOTICE $nick :\037ERROR\037: This setting is already enabled."; return} channel set $chan +talkz putquick "NOTICE $nick :Enabled Autoreply Thanks System for $chan" return 0 } if {[lindex [split $arg] 1] == "off"} { if {![channel get $chan talkz]} {putquick "NOTICE $nick :\037ERROR\037: This setting is already disabled."; return} channel set $chan -talkz putquick "NOTICE $nick :Disabled Autoreply Thanks System for $chan" return 0 } } } proc op:check {nick uhost hand chan mode {target ""}} { global botnick thankstext if {![channel get $chan talkz]} {return} if {[string match $botnick $target]} { set replyopmsg [lindex $thankstext [rand [llength $thankstext]]] set replyopmsg [subst -nocommands $replyopmsg] puthelp "PRIVMSG $chan :$replyopmsg" return 0 } } proc deop:check {nick uhost hand chan mode {target ""}} { global botnick complaintext if {![channel get $chan talkz]} {return} if {[string match $botnick $target]} { set replydeopmsg [lindex $complaintext [rand [llength $complaintext]]] set replydeopmsg [subst -nocommands $replydeopmsg] puthelp "PRIVMSG $chan :$replydeopmsg" return 0 } } proc voice:check {nick uhost hand chan mode {target ""}} { global botnick thankstext if {![channel get $chan talkz]} {return} if {[string match $botnick $target]} { set replyvoicemsg [lindex $thankstext [rand [llength $thankstext]]] set replyvoicemsg [subst -nocommands $replyvoicemsg] puthelp "PRIVMSG $chan :$replyvoicemsg" return 0 } } proc devoice:check {nick uhost hand chan mode {target ""}} { global botnick complaintext if {![channel get $chan talkz]} {return} if {[string match $botnick $target]} { set replydevoicemsg [lindex $complaintext [rand [llength $complaintext]]] set replydevoicemsg [subst -nocommands $replydevoicemsg] puthelp "PRIVMSG $chan :$replydevoicemsg" return 0 } } putlog ".:autoreply.tcl,v1.7:. Loaded! - istok @ IRCSpeed"
  17. # $Id: adduser-joinmodes.tcl,v1.6 04/03/2016 07:00:31am GMT +12 (NZST) IRCSpeed Exp $ # ----- ADDING USERS ----- (Basic User adding) # Commands are: # !addowner nickname # !addmaster nickname # !addgop nickname # !addchanowner nickname # !addsop nickname # !delsop nickname # !addaop nickname # !delaop nickname # !addaov nickname # !delaov nickname # ----- JoinModes ----- (This enforces joinmodes @/+) # JoinModes Public Commands: # Enable: !joinmodes on # Disable: !joinmodes off # JoinModes Message Command: # /msg botnick joinmodes #channel on|off # -----------EDIT BELOW------------ # Set this to whatever trigger you like. (default: !) set addusertrig "!" # You don't need to edit the access flags. They are added like this because each command requires different access. # This is to ensure that user's can't add/del those with more access. If you wish to edit them, edit the proc directly. # ------EDIT COMPLETE!!------ setudef flag joinmode proc addTrigger {} { global addusertrig return $addusertrig } bind join - * join:modes bind pub - ${addusertrig}addowner addowner:pub bind pub - ${addusertrig}addmaster addmaster:pub bind pub - ${addusertrig}addgop addgop:pub bind pub - ${addusertrig}addchanowner addcowner:pub bind pub - ${addusertrig}addsop addsop:pub bind pub - ${addusertrig}delsop delsop:pub bind pub - ${addusertrig}addaop addaop:pub bind pub - ${addusertrig}delaop delaop:pub bind pub - ${addusertrig}addaov addaov:pub bind pub - ${addusertrig}delaov delaov:pub bind pub - ${addusertrig}joinmodes jmode:pub bind msg - joinmodes jmode:msg proc addowner:pub {nick uhost hand chan arg} { if {![matchattr [nick2hand $nick] n]} {return} set owneradd [lindex [split $arg] 0] if {[lindex [split $arg] 0] == ""} {putquick "PRIVMSG $chan :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [addTrigger]addowner nickname"; return} if {[validuser [nick2hand $owneradd]]} {putquick "PRIVMSG $chan :\037ERROR\037: $owneradd is already a valid user."; return} if {![onchan $owneradd $chan]} {putquick "PRIVMSG $chan :\037ERROR\037: $owneradd is not even on $chan ..."; return} set mask *!*@[lindex [split [getchanhost $owneradd $chan] @] 1] adduser $owneradd $mask chattr $owneradd +n putquick "NOTICE $nick :Added $owneradd to the Global Owner List." putquick "NOTICE $owneradd :$nick ($hand) has added you to the Global Owner List." } proc addmaster:pub {nick uhost hand chan arg} { if {![matchattr [nick2hand $nick] n]} {return} set masteradd [lindex [split $arg] 0] if {[lindex [split $arg] 0] == ""} {putquick "PRIVMSG $chan :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [addTrigger]addmaster nickname"; return} if {[validuser [nick2hand $masteradd]]} {putquick "PRIVMSG $chan :\037ERROR\037: $masteradd is already a valid user."; return} if {![onchan $masteradd $chan]} {putquick "PRIVMSG $chan :\037ERROR\037: $masteradd is not even on $chan ..."; return} set mask *!*@[lindex [split [getchanhost $masteradd $chan] @] 1] adduser $masteradd $mask chattr $masteradd +m putquick "NOTICE $nick :Added $masteradd to the Global Master List." putquick "NOTICE $masteradd :$nick ($hand) has added you to the Global Master List." } proc addgop:pub {nick uhost hand chan arg} { if {![matchattr [nick2hand $nick] m]} {return} set gopadd [lindex [split $arg] 0] if {[lindex [split $arg] 0] == ""} {putquick "PRIVMSG $chan :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [addTrigger]addgop nickname"; return} if {[validuser [nick2hand $gopadd]]} {putquick "PRIVMSG $chan :\037ERROR\037: $gopadd is already a valid user."; return} if {![onchan $gopadd $chan]} {putquick "PRIVMSG $chan :\037ERROR\037: $gopadd is not even on $chan ..."; return} set mask *!*@[lindex [split [getchanhost $gopadd $chan] @] 1] adduser $gopadd $mask chattr $gopadd +o putquick "NOTICE $nick :Added $gopadd to the Global OP List." putquick "NOTICE $gopadd :$nick ($hand) has added you to the Global OP List." } proc addcowner:pub {nick uhost hand chan arg} { if {![matchattr [nick2hand $nick] o]} {return} set cowneradd [lindex [split $arg] 0] if {[lindex [split $arg] 0] == ""} {putquick "PRIVMSG $chan :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [addTrigger]addchanowner nickname"; return} if {[validuser [nick2hand $cowneradd]]} {putquick "PRIVMSG $chan :\037ERROR\037: $cowneradd is already a valid user."; return} if {![onchan $cowneradd $chan]} {putquick "PRIVMSG $chan :\037ERROR\037: $cowneradd is not even on $chan ..."; return} set mask *!*@[lindex [split [getchanhost $cowneradd $chan] @] 1] if {[onchan $cowneradd $chan] && ![isop $cowneradd $chan]} {putquick "MODE $chan +o $cowneradd"} adduser $cowneradd $mask chattr $cowneradd -|n $chan putquick "NOTICE $nick :Added $cowneradd to the Channel Owner List for $chan" putquick "NOTICE $cowneradd :$nick ($hand) has added you to the Channel Owner List for $chan" } proc addsop:pub {nick uhost hand chan arg} { if {![matchattr [nick2hand $nick] o|n $chan]} {return} set sopadd [lindex [split $arg] 0] if {[lindex [split $arg] 0] == ""} {putquick "PRIVMSG $chan :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [addTrigger]addsop nickname"; return} if {[validuser [nick2hand $sopadd]]} {putquick "PRIVMSG $chan :\037ERROR\037: $sopadd is already a valid user."; return} if {![onchan $sopadd $chan]} {putquick "PRIVMSG $chan :\037ERROR\037: $sopadd is not even on $chan ..."; return} set mask *!*@[lindex [split [getchanhost $sopadd $chan] @] 1] if {[onchan $sopadd $chan] && ![isop $sopadd $chan]} {putquick "MODE $chan +o $sopadd"} adduser $sopadd $mask chattr $sopadd -|m $chan putquick "NOTICE $nick :Added $sopadd to the SOP List for $chan" putquick "NOTICE $sopadd :$nick ($hand) has added you to the SOP List for $chan" } proc delsop:pub {nick uhost hand chan arg} { if {![matchattr [nick2hand $nick] o|n $chan]} {return} set sopdel [lindex [split $arg] 0] if {[lindex [split $arg] 0] == ""} {putquick "PRIVMSG $chan :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [addTrigger]delsop nickname"; return} if {![validuser [nick2hand $sopdel]]} {putquick "PRIVMSG $chan :\037ERROR\037: $sopdel is not a valid user."; return} if {[onchan $sopdel $chan] && [isop $sopdel $chan]} {putquick "MODE $chan -o $sopdel"} deluser $sopdel putquick "NOTICE $nick :Deleted $sopdel from the SOP List for $chan" putquick "NOTICE $sopdel :$nick ($hand) has deleted you from the SOP List for $chan" } proc addaop:pub {nick uhost hand chan arg} { if {![matchattr [nick2hand $nick] o|m $chan]} {return} set opadd [lindex [split $arg] 0] if {[lindex [split $arg] 0] == ""} {putquick "PRIVMSG $chan :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [addTrigger]addaop nickname"; return} if {[validuser [nick2hand $opadd]]} {putquick "PRIVMSG $chan :\037ERROR\037: $opadd is already a valid user."; return} if {![onchan $opadd $chan]} {putquick "PRIVMSG $chan :\037ERROR\037: $opadd is not even on $chan ..."; return} set mask *!*@[lindex [split [getchanhost $opadd $chan] @] 1] if {[onchan $opadd $chan] && ![isop $opadd $chan]} {putquick "MODE $chan +o $opadd"} adduser $opadd $mask chattr $opadd -|o $chan putquick "NOTICE $nick :Added $opadd to the AOP List for $chan" putquick "NOTICE $opadd :$nick ($hand) has added you to the AOP List for $chan" } proc delaop:pub {nick uhost hand chan arg} { if {![matchattr [nick2hand $nick] o|m $chan]} {return} set opdel [lindex [split $arg] 0] if {[lindex [split $arg] 0] == ""} {putquick "PRIVMSG $chan :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [addTrigger]delaop nickname"; return} if {![validuser [nick2hand $opdel]]} {putquick "PRIVMSG $chan :\037ERROR\037: $opdel is not a valid user."; return} if {[onchan $opdel $chan] && [isop $opdel $chan]} {putquick "MODE $chan -o $opdel"} deluser $opdel putquick "NOTICE $nick :Deleted $opdel from the AOP List for $chan" putquick "NOTICE $opdel :$nick ($hand) has deleted you from the AOP List for $chan" } proc addaov:pub {nick uhost hand chan arg} { if {![matchattr [nick2hand $nick] o|o $chan]} {return} set aovadd [lindex [split $arg] 0] if {[lindex [split $arg] 0] == ""} {putquick "PRIVMSG $chan :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [addTrigger]addaov nickname"; return} if {[validuser [nick2hand $aovadd]]} {putquick "PRIVMSG $chan :\037ERROR\037: $aovadd is already a valid user."; return} set mask *!*@[lindex [split [getchanhost $aovadd $chan] @] 1] if {[onchan $aovadd $chan] && ![isvoice $aovadd $chan]} {putquick "MODE $chan +v $aovadd"} adduser $aovadd $mask chattr $aovadd -|v $chan putquick "NOTICE $nick :Added $aovadd to the AOV List for $chan" putquick "NOTICE $aovadd :$nick ($hand) has added you to the AOV List for $chan" } proc delaov:pub {nick uhost hand chan arg} { if {![matchattr [nick2hand $nick] o|o $chan]} {return} set aovdel [lindex [split $arg] 0] if {[lindex [split $arg] 0] == ""} {putquick "PRIVMSG $chan :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [addTrigger]delaov nickname"; return} if {![validuser [nick2hand $aovdel]]} {putquick "PRIVMSG $chan :\037ERROR\037: $aovdel is not a valid user."; return} if {[onchan $aovdel $chan] && [isvoice $aovdel $chan]} {putquick "MODE $chan -v $aovdel"} deluser $aovdel putquick "NOTICE $nick :Deleted $aovdel from the AOV List for $chan" putquick "NOTICE $aovdel :$nick ($hand) has deleted you from the AOV List for $chan" } proc jmode:pub {nick uhost hand chan arg} { if {![matchattr [nick2hand $nick] o|n $chan]} {return} if {[lindex [split $arg] 0] == ""} {putquick "PRIVMSG $chan :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [addTrigger]joinmodes on|off"; return} if {[lindex [split $arg] 0] == "on"} { if {[channel get $chan joinmode]} {putquick "PRIVMSG $chan :\037ERROR\037: This setting is already enabled."; return} channel set $chan +joinmode putquick "PRIVMSG $chan :Enabled Auto @/+ Modes for $chan" return 0 } if {[lindex [split $arg] 0] == "off"} { if {![channel get $chan joinmode]} {putquick "PRIVMSG $chan :\037ERROR\037: This setting is already disabled."; return} channel set $chan -joinmode puthelp "PRIVMSG $chan :Disabled Auto @/+ Modes for $chan" } } proc jmode:msg {nick uhost hand arg} { global botnick set chan [strlwr [lindex $arg 0]] if {![matchattr [nick2hand $nick] o|n $chan]} {return} if {([lindex [split $arg] 0] == "") && ([string match "*#*" $arg])} {putquick "NOTICE $nick :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: /msg $botnick joinmodes #channel on|off"; return} if {([lindex [split $arg] 1] == "") && ([string match "*#*" $arg])} {putquick "NOTICE $nick :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: /msg $botnick joinmodes $chan on|off"; return} if {([lindex [split $arg] 1] == "on") && ([string match "*#*" $arg])} { if {[channel get $chan joinmode]} {putquick "NOTICE $nick :\037ERROR\037: This setting is already enabled."; return} channel set $chan +joinmode putquick "NOTICE $nick :Enabled Auto @/+ Modes for $chan" return 0 } if {([lindex [split $arg] 1] == "off") && ([string match "*#*" $arg])} { if {![channel get $chan joinmode]} {putquick "NOTICE $nick :\037ERROR\037: This setting is already disabled."; return} channel set $chan -joinmode putquick "NOTICE $nick :Disabled Auto @/+ Modes for $chan" return 0 } } proc join:modes {nick uhost hand chan} { global botnick if {[string tolower $nick] != [string tolower $botnick]} { if {[channel get $chan joinmode] && [botisop $chan]} { if {[matchattr [nick2hand $nick] |n $chan]} { putquick "MODE $chan +o $nick" return 0 } if {[matchattr [nick2hand $nick] |m $chan]} { putquick "MODE $chan +o $nick" return 0 } if {[matchattr [nick2hand $nick] |o $chan]} { putquick "MODE $chan +o $nick" return 0 } if {[matchattr [nick2hand $nick] |v $chan]} { putquick "MODE $chan +v $nick" return 0 } } } } putlog "AddUSER+JoinMODEs: Module LOADED! - istok @ IRCSpeed"
  18. # $Id: bans.tcl,v1.2 04/03/2016 05:41:42am GMT +12 (NZST) IRCSpeed Exp $ # Commands: # !bans <=- shows channel ban list. # !globans <=- shows global ban list. # !addban *!*@banmask.etc reasons-for-ban <=- adds a channel ban. # !delban *!*@banmask.etc <=- removes a channel ban. # !gban *!*@banmask.etc reasons-for-ban <=- adds a global ban. # !delgban *!*@banmask.etc <=- removes a global ban. # MSGCMD: /msg botnick bans <=- shows global ban list. # MSGCMD: /msg botnick bans #channel <=- shows channel ban list. ################################################################### # Set global command trigger (default: !) set banstriga "!" # Set global access flags to use these commands (default: o) # This global access flag is able to use: !bans, !globans, !gban, !delgban, !addban, !delban set banglobflags o # Set channel access flags to use these commands (default: m) # This channel access flag is only able to use: !bans, !addban, !delban (like akick, for SOP) set banchanflags m proc getBanTriga {} { global banstriga return $banstriga } bind pub - ${banstriga}bans chan:bans proc chan:bans {nick uhost hand chan arg} { global banglobflags banchanflags if {[matchattr [nick2hand $nick] $banglobflags|$banchanflags $chan]} { putquick "PRIVMSG $chan :\002BANLIST\002 for $chan sent to $nick" putserv "NOTICE $nick :********* \002$chan BanList\002 **********" foreach botban [banlist $chan] { putserv "NOTICE $nick :\002BOTBAN\002: $botban" } putserv "NOTICE $nick :********** \002$chan BanList \037END\037\002 **********" } } bind pub - ${banstriga}globans glo:bans proc glo:bans {nick uhost hand chan arg} { global banglobflags if {[matchattr [nick2hand $nick] $banglobflags]} { putquick "PRIVMSG $chan :\002GLOBAL BANLIST\002 sent to $nick" putquick "NOTICE $nick :********* \002Global BanList\002 **********" foreach globan [banlist] { putquick "NOTICE $nick :\002GLOBAN\002: $globan" } putquick "NOTICE $nick :********** \002Global BanList \037END\037\002 **********" } } bind msg - bans ban:list proc ban:list {nick uhost hand arg} { global banglobflags banchanflags if {([lindex $arg 0] == "") && ([matchattr [nick2hand $nick] $banglobflags])} { putquick "NOTICE $nick :********** \002Global BanList\002 **********" foreach globban [banlist] { putquick "NOTICE $nick :\002GLOBBAN\002: $globban" } putquick "NOTICE $nick :********** \002Global BanList \037END\037\002 **********" } else { set chan [strlwr [lindex $arg 0]] if {([lindex [split $arg] 0] != "") && ([matchattr [nick2hand $nick] $banglobflags|$banchanflags $chan])} { putquick "NOTICE $nick :********** \002$chan BanList\002 **********" foreach chanban [banlist $chan] { putquick "NOTICE $nick :\002CHANBAN\002: $chanban" } putquick "NOTICE $nick :********** \002$chan BanList \037END\037\002 **********" } } } bind pub - ${banstriga}addban banint:pub proc banint:pub {nick uhost hand chan arg} { global banglobflags banchanflags if {![matchattr [nick2hand $nick] $banglobflags|$banchanflags $chan]} {return} set banmask [lindex [split $arg] 0] if {$banmask == ""} {putquick "NOTICE $nick \037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [getBanTriga]addban *!*@banmask.etc reason-for-ban"; return} if {[isban $banmask $chan]} {putquick "PRIVMSG $chan :\037ERROR\037: Banmask already exists."; return} set banreason [join [lrange [split $arg] 1 end]] if {$banreason == ""} {putquick "NOTICE $nick \037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [getBanTriga]addban *!*@banmask.etc reason-for-ban"; return} putquick "MODE $chan +b $banmask" newchanban "$chan" "$banmask" "$nick" "$banreason" 0 putquick "NOTICE $nick :Successfully Added Ban: $banmask for $chan" return 0 } bind pub - ${banstriga}delban unbanint:pub proc unbanint:pub {nick uhost hand chan arg} { global banglobflags banchanflags if {![matchattr [nick2hand $nick] $banglobflags|$banchanflags $chan]} {return} set unbanmask [lindex [split $arg] 0] if {$unbanmask == ""} {putquick "NOTICE $nick \037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [getBanTriga]delban *!*@banmask.etc"; return} if {![isban $unbanmask $chan]} {putquick "PRIVMSG $chan :\037ERROR\037: Banmask not found."; return} killchanban $chan $unbanmask putquick "NOTICE $nick :Successfully Deleted Ban: $unbanmask for $chan" return 0 } bind pub - ${banstriga}gban gban:pub proc gban:pub {nick uhost hand chan arg} { global banglobflags if {![matchattr [nick2hand $nick] $banglobflags]} {return} set banmask [lindex [split $arg] 0] if {$banmask == ""} {putquick "NOTICE $nick \037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [getBanTriga]gban *!*@banmask.etc reason-for-ban"; return} if {[isban $banmask]} {putquick "NOTICE $nick :\037ERROR\037: Banmask already exists."; return} set banreason [join [lrange [split $arg] 1 end]] if {$banreason == ""} {putquick "NOTICE $nick \037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [getBanTriga]gban *!*@banmask.etc reason-for-ban"; return} newban $banmask $nick $banreason 0 putquick "NOTICE $nick :Successfully Added Global Ban: $banmask for: [channels]" return 0 } bind pub - ${banstriga}delgban unbanglob:pub proc unbanglob:pub {nick uhost hand chan arg} { global banglobflags if {![matchattr [nick2hand $nick] $banglobflags]} {return} set unbanmask [lindex [split $arg] 0] if {$unbanmask == ""} {putquick "NOTICE $nick \037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [getBanTriga]delgban *!*@banmask.etc"; return} if {![isban $unbanmask]} {putquick "NOTICE $nick :\037ERROR\037: Banmask not Found."; return} killban $unbanmask putquick "NOTICE $nick :Successfully Deleted Global Ban: $unbanmask for: [channels]" return 0 } putlog "LOADED .:Bans.tcl:. - istok @ IRCSpeed"
  19. Will work in any channel the BOT is on... It's written ( and working ) on mIRC Ver. 6.35 Includes UserDB ( Tracks words, lines and characters ), !SEEN and AWAY system Will notice user of other user being AWAY Meaning if anyone types a that's currently AWAY the bot will tell you how long since he/she went AFK and why / reason ( if a reason is given that is ) NOTE: This doesn't work if your highlighting yourself... only works when other users "check" ;*** Downloaded from Hawkee - http://www.hawkee.com/snippet/8545/ on *:TEXT:*:#:mEvent_Scan $strip($1-) on *:ACTiON:*:#:mEvent_Scan $strip($1-) on *:JOiN:#:mEvent_Scan $strip($1-) on *:PART:#:mEvent_Scan $strip($1-) on *:KICK:#:mEvent_Scan $strip($1-) on *:BAN:#:mEvent_Scan $strip($1-) on *:UNBAN:#:mEvent_Scan $strip($1-) on *:MODE:#:mEvent_Scan $strip($1-) on *:RAWMODE:#:mEvent_Scan $strip($1-) on *:TOPiC:#:mEvent_Scan $strip($1-) on *:QUiT:mEvent_Scan $strip($1-) | UserDB on *:NiCK:mEvent_Scan $newnick ;************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************ on *:START:UserDB on *:EXiT:UserDB on *:DiSCONNECT:UserDB ;************************************************************************************************************************ alias UserDB { if ($event == Start) { if (!$hget(UserDB)) { hmake UserDB 1000 } | if ($isfile(SRU\Users\UserDB.hsh)) { hload UserDB SRU\Users\UserDB.hsh } } elseif (($event == Text) || ($event == Exit) || ($event == Quit) || ($event == Disconnect)) && ($hget(UserDB)) { hsave UserDB SRU\Users\UserDB.hsh | $iif($event == Text,msg # I've saved the User Database or updated if it... same same... but different) } } ;****************************************************************************************** ;*** Output section *** Output section *** Output section *** Output section *** ;****************************************************************************************** ;*** Nicknames - Used to color nick-names alias mNiCK { return $+(13,$1-,) } ;******************************************************************************* ;*** Channel - Used to color channels alias mCHAN { return $+(3,$1-,) } ;******************************************************************************* ;*** Network - Used to color networks alias mNetC { return $+(14,$1-,) } ;******************************************************************************* ;*** "NUMBERs" - Used to color number output alias mNUM { return $+(04,$1-,) } ;******************************************************************************* ;*** START "BRACKET" - Used to make a start "bracket" in a output line alias mSTART return 15ooO( ;******************************************************************************* ;*** END "BRACKET" - Used to end a start "bracket" in a output line alias mEND return 15) ;******************************************************************************* ;*** SPACER - User as a spacer inbetween random "stats" alias mSPACE return 14-5#14- ;****************************************************************************************** ;****************************************************************************************** ;*** DO NOT TOUCH UNLESS YOU KNOW WHAT YOU ARE DOiNG *** ;****************************************************************************************** ;*** Seen - Used to change output when doing !SEEN alias mReplaceSEEN return $+($replacex($1-,SCREW,screwing,fark,f*cking,RAPE,raping,MOLEST,molesting,SLAP,slaping,SWAFFEL,swaffeling,SEEN,looking for13,$+(iDLE,$chr(32)),doing a idle check on 13,$+(PiNG,$chr(32)),$+($mCMDS(!PiNG),'iNG) 13,$+(USER,$chr(32)),doing a $mCMDS(!User) check on 13,$+(IRCStats,$chr(32)),checking IRCStats for 13,$+(KiCK,$chr(32)),tossing 13,$+(UNBAN,$chr(32)),unbanning 13,$+(BAN,$chr(32)),banning 13,TEXT,writing,ACTiON,acting,JOiN,entering,PART,leaving,QUiT,quitting,TOPiC,changing topic to,RAWMODE,setting usermode,MODE,changing mode to),) ;*** Time - Used to change time output when doing !SEEN alias mReplaceCTiME return $replacex($duration($calc($ctime -$1)),WKS,weeks,WK,week,DAYS,days,DAY,day,MiNS,minutes,MiN,minute,SECS,seconds,SEC,second) ;*** StatsDB - Used to replace special characters in niks before attempting to save DB alias mReplaceStatsDB return $replace($remove($strip($1),[,],<,>,@,~,&,%,+),[,@,],~,|,-) ;*** Nick - Used to get usermodes on channel alias mReplaceNiCK return $+($iif($left($nick(#,$nick).pnick,1) != $left($nick,1),$remove($left($nick(#,$nick).pnick,1),$nick)),$nick) ;****************************************************************************************** alias mEvent_Scan { ;************************************************************************************************************************ ;*** !Login - Used to set to current vHost if ($event == TEXT) && ($istok(!LOGiN,$1,32)) && ($hget(UserDB,$address($nick,2)) != $nick) { set -u1 %Event-MSG Changed nick from $v1 to $nick | var %nc = $addtok($ial($newnick).mark,$nick,32) | .ialmark $nick %nc | hadd -m UserDB $wildsite %nc | hsave UserDB SRU\Users\UserDB.hsh | .notice $nick [7UserDB] Updated - %Event-MSG } elseif ($event == TEXT) && ($istok(!LOGiN,$1,32)) { msg # Your host is already set to $nick - 4Note This isn't to change your nick... but to change your vHost to current nick } ;*** !NewNick - I forgot why I coded this... but will allow you to change you're vHost to other nick then currently using elseif ($event == TEXT) && ($istok(!NEWN !NEWNiCK,$1,32)) && ($hget(UserDB,$address($nick,2))) { set -u1 %Event-MSG Changed nick from $v1 to $2 | var %nc = $addtok($ial($newnick).mark,$2,32) | .ialmark $2 %nc | hadd -m UserDB $wildsite %nc | hsave UserDB SRU\Users\UserDB.hsh | .notice $nick [7UserDB] Updated - %Event-MSG } ;******************************************************************************************************************************* ;*** Check Status - Used to make sure it doesn't try to write when it's already writing if (%TEXT-NiCK) { return } ;******************************************************************************************************************************* ;*** Already added? - Checking to see if nick is already added (Using adress/vHost/$wildsite) (If it isn't found in the hash tables it will add for later use) elseif (!$hget(UserDB,$address($nick,2))) { var %Adress = $addtok($ial($newnick).mark,$nick,32) | .ialmark $nick %Adress | hadd -m UserDB $wildsite %Adress } ;******************************************************************************************************************************* ;*** Setting nick - Checking UserDB.hsh for the correct nick var %Event-NiCK $hget(UserDB,$address($nick,2)), %TEXT-NiCK $replacex(%Event-NiCK,[,@,],~,|,-) ;******************************************************************************************************************************* $iif($isdir($mircdir\SRU) == $false,mkDir $mircdir\SRU) | $iif($isdir($mircdir\SRU\Users) == $false,mkDir $mircdir\SRU\Users) ;******************************************************************************************************************************* ;*** # # ####### ####### ####### # # ;*** # # #### ###### ##### #### ##### ## ##### #### # # # # # # # ;*** # # # # # # # # # # # # # # # # # # # ;*** # # #### ##### # # #### # # # # #### # # # # # # # ;*** # # # # ##### # # ###### # # # # # # ####### # ;*** # # # # # # # # # # # # # # # # # # # # # # ;*** ##### #### ###### # # #### # # # # #### # ####### # # # ####### ;******************************************************************************************************************************* ;*** START DATE/DAY + TiME ***************************************************************************************************** if (!$readini($+(SRU\Users\,%TEXT-NiCK,.ini),iNFO,STARTDATE)) { writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) iNFO STARTDATE $fulldate | writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) iNFO STARTTiME $ctime | writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) iNFO STARTDAY $day | writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) TODAY DAY $date | writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) TODAY TiME $ctime } ;*** DATE TODAY SECTiON ******************************************************************************************************** elseif ($readini($+(SRU\Users\,%TEXT-NiCK,.ini),TODAY,DAY) != $date) { remini $+(SRU\Users\,%TEXT-NiCK,.ini) TODAY | writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) TODAY DAY $date | writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) TODAY TiME $ctime } ;******************************************************************************************************************************* if ($event == JOiN) && (%PART- [ $+ [ $+($network,$chan) ] ] == %TEXT-NiCK) { writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) TODAY Hops $calc($readini($+(SRU\Users\,%TEXT-NiCK,.ini),TODAY,Hops) +1) | $iif($readini($+(SRU\Users\,%TEXT-NiCK,.ini),TODAY,PARTs) <= 1,remini $+(SRU\Users\,%TEXT-NiCK,.ini) TODAY PARTs,writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) TODAY PARTs $calc($readini($+(SRU\Users\,%TEXT-NiCK,.ini),TODAY,PARTs) -1)) | writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) TOTAL Hops $calc($readini($+(SRU\Users\,%TEXT-NiCK,.ini),TOTAL,Hops) +1) | $iif($readini($+(SRU\Users\,%TEXT-NiCK,.ini),TOTAL,PARTs) <= 1,remini $+(SRU\Users\,%TEXT-NiCK,.ini) TOTAL PARTs,writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) TOTAL PARTs $calc($readini($+(SRU\Users\,%TEXT-NiCK,.ini),TOTAL,PARTs) -1)) | goto END } elseif ($event != TEXT && $event != ACTiON) && ($readini($+(SRU\Users\,%TEXT-NiCK,.ini),iNFO,STARTDATE)) { $iif($event == PART,set -u7 %PART- [ $+ [ $+($network,$chan) ] ] %TEXT-NiCK) | writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) TODAY $+($upper($event),s) $calc($readini($+(SRU\Users\,%TEXT-NiCK,.ini),TODAY,$+($upper($event),s)) +1) | writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) TOTAL $+($upper($event),s) $calc($readini($+(SRU\Users\,%TEXT-NiCK,.ini),TOTAL,$+($upper($event),s)) +1) | goto END } ;******************************************************************************************************************************* ;****** Total ( Words, Lines & Characters ) writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) TOTAL Words $calc($readini($+(SRU\Users\,%TEXT-NiCK,.ini),TOTAL,Words) +$0) writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) TOTAL Lines $calc($readini($+(SRU\Users\,%TEXT-NiCK,.ini),TOTAL,Lines) +1) writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) TOTAL Characters $calc($readini($+(SRU\Users\,%TEXT-NiCK,.ini),TOTAL,Characters) +$len($remove($1-,$chr(32)))) ;*** Today ( Words, Lines & Characters ) writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) TODAY Words $calc($readini($+(SRU\Users\,%TEXT-NiCK,.ini),TODAY,Words) +$0) writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) TODAY Lines $calc($readini($+(SRU\Users\,%TEXT-NiCK,.ini),TODAY,Lines) +1) writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) TODAY Characters $calc($readini($+(SRU\Users\,%TEXT-NiCK,.ini),TODAY,Characters) +$len($remove($1-,$chr(32)))) ;*** END UserDB SECTiON ******************************************************************************************************** ;******************************************************************************************************************************* ;*** AWAY SECTiON if ($remove($strip($1),!,@,.,+,-) == AWAY) || ($remove($strip($1),!,@,.,+,-) == AFK) || ($remove($strip($1),!,@,.,+,-) == BRB) || ($remove($strip($1),!,@,.,+,-) == BBL) || ($remove($strip($1),!,@,.,+,-) == TTYL) { $iif(!$readini(SRU\StatsDB.ini,$replace($nick,[,@,],~,|,-),AWAY),msg # $+(13,$nick,) is now marked as $+(3,AWAY,) $+(15ooO,$chr(40),) As in not here... $+(15,$chr(41),),$iif(!$2,return,.notice $nick Your $+(3,AWAY,) messages has been "updated" to -> $2-)) | writeini -n SRU\StatsDB.ini $replace($nick,[,@,],~,|,-) AWAY $ctime | writeini -n SRU\StatsDB.ini $replace($nick,[,@,],~,|,-) AWAYre $iif(!$2,N/A as in Not Available,$2-) } ;*** BACK / BaK elseif ($readini(SRU\StatsDB.ini,$replace($nick,[,@,],~,|,-),AWAY)) && ((BACK isin $strip($1-)) || (BAK isin $strip($1-)) || ($calc($ctime -$readini(SRU\StatsDB.ini,$replace($nick,[,@,],~,|,-),AWAY)) >= 600)) { set -u1 %T $v1 | $iif(!$timer($+(Back,$network,$chan)),msg # $+(13,$nick,) is now $+(03,$iif(BaK isin $1-,BAK,BACK),) $+(15ooO,$chr(40),) As in back at keyboard... $+(15,$chr(41),),.notice $nick Welcome back $+(13$nick,) you're no longer marked as $+(3AWAY)) | remini SRU\StatsDB.ini $replace($nick,[,@,],~,|,-) AWAY | remini SRU\StatsDB.ini $replace($nick,[,@,],~,|,-) AWAYre | $+(.timer,Back,$network,$chan) 1 5 noop } ;*** NOTE <NiCK> is AWAY elseif (!$timer($+(Away,$network,$chan))) && (($readini(SRU\StatsDB.ini,$mReplaceStatsDB($1),AWAYre)) || ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($2),AWAYre)) || ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($3),AWAYre)) || ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($4),AWAYre)) || ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($5),AWAYre)) || ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($6),AWAYre)) || ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($7),AWAYre)) || ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($8),AWAYre)) || ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($9),AWAYre)) || ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($10),AWAYre)) || ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($11),AWAYre)) || ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($12),AWAYre)) || ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($13),AWAYre)) || ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($14),AWAYre)) || ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($15),AWAYre)) || ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($16),AWAYre)) || ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($17),AWAYre)) || ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($18),AWAYre)) || ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($19),AWAYre)) || ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($20),AWAYre))) { $+(.timer,Away,$network,$chan) 1 4 noop | set -u1 %RE $v1 if ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($1),AWAY)) { set -u1 %X $1 } | elseif ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($2),AWAY)) { set -u1 %X $2 } | elseif ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($3),AWAY)) { set -u1 %X $3 } | elseif ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($4),AWAY)) { set -u1 %X $4 } | elseif ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($5),AWAY)) { set -u1 %X $5 } | elseif ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($6),AWAY)) { set -u1 %X $6 } | elseif ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($7),AWAY)) { set -u1 %X $7 } | elseif ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($8),AWAY)) { set -u1 %X $8 } | elseif ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($9),AWAY)) { set -u1 %X $9 } | elseif ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($10),AWAY)) { set -u1 %X $10 } elseif ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($11),AWAY)) { set -u1 %X $11 } | elseif ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($12),AWAY)) { set -u1 %X $12 } | elseif ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($13),AWAY)) { set -u1 %X $13 } | elseif ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($14),AWAY)) { set -u1 %X $14 } | elseif ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($15),AWAY)) { set -u1 %X $15 } | elseif ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($16),AWAY)) { set -u1 %X $16 } | elseif ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($17),AWAY)) { set -u1 %X $17 } | elseif ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($18),AWAY)) { set -u1 %X $18 } | elseif ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($19),AWAY)) { set -u1 %X $19 } | elseif ($readini(SRU\StatsDB.ini,$mReplaceStatsDB($20),AWAY)) { set -u1 %X $20 } $iif($strip(%X) != $nick,msg # [4NOTE] $+(13,$nick,) -> Currently $+(04,$replacex($duration($calc($ctime -$readini(SRU\StatsDB.ini,$mReplaceStatsDB(%X),AWAY))),WKS,weeks,WK,week,DAYS,days,DAY,day,MiNS,minutes,MiN,minute,SECS,seconds,SEC,second),)) since $+(13,$nick(#,$nick(#,%X)),) went $+(3AFK) $+(15ooO,$chr(40),) %RE $+(15,$chr(41),)) } ;********************************************************************************************************************************************************************************************************************************************** ;*** !SEEN elseif ($1 == !SEEN) && ($readini($+(SRU\Users\,$replace($iif(!$2,$nick,$strip($2)),[,@,],~,|,-),.ini),SEEN,LAST) != $null) && (!$timer($+(SeenSearch,$network,$nick))) { $+(.timer,SeenSearch,$network,$nick) 1 3 noop | set -u1 %2 $replace($iif(!$2,$nick,$strip($2)),[,@,],~,|,-) msg # Last seen $mReplaceSEEN($iif($readini($+(SRU\Users\,%2,.ini),SEEN,ACTiON) != $null,$v1 $+($readini($+(SRU\Users\,%2,.ini),SEEN,ViCTiM),),$iif($istok(%ChanHiDDEN,$readini($+(SRU\Users\,%2,.ini),SEEN,CHAN),32) && $readini($+(SRU\Users\,%2,.ini),SEEN,CHAN) == $chan,$readini($+(SRU\Users\,%2,.ini),SEEN,DOiNG),$iif(!$istok(%ChanHiDDEN,$readini($+(SRU\Users\,%2,.ini),SEEN,CHAN),32),$readini($+(SRU\Users\,%2,.ini),SEEN,DOiNG),$readini($+(SRU\Users\,%2,.ini),SEEN,LAST))))) $& $iif($readini($+(SRU\Users\,%2,.ini),SEEN,CHAN) && $readini($+(SRU\Users\,%2,.ini),SEEN,CHAN) != $chan,$iif($readini($+(SRU\Users\,%2,.ini),SEEN,LAST) != PART && $readini($+(SRU\Users\,%2,.ini),SEEN,LAST) != JOiN,inside) $mCHAN($readini($+(SRU\Users\,%2,.ini),SEEN,CHAN))) $iif($readini($+(SRU\Users\,%2,.ini),SEEN,WHERE) != $network,on $mNetC($v1)) $iif($readini($+(SRU\Users\,%2,.ini),SEEN,REASON),$v1) $& 15ooO( $iif($readini($+(SRU\Users\,%2,.ini),SEEN,DATE) != $day $date(dd/mm/yyyy),$mDATE($v1) like) $mNUM($mReplaceCTiME($readini($+(SRU\Users\,%2,.ini),SEEN,TiME)) ago) $iif($readini($+(SRU\Users\,%2,.ini),LAST,$network) && $readini($+(SRU\Users\,%2,.ini),SEEN,WHERE) != $network,$mSPACE Last seen on $mNetC($network) like $mNUM($duration($calc($ctime -$readini($+(SRU\Users\,%2,.ini),LAST,$network))) ago)) 15) } ;*************************************************************************************************************************************************** ;*** !IRCStats elseif ($1 == !U) || ($1 == !USER) || ($1 == !IRCSTATS) { ;***************************************************************************** ;*** SETTiNG NiCK set -u1 %2 $iif(!$2,$nick,$iif($strip($2) ison $chan,$nick(#,$nick(#,$v1)),$iif($readini($+(SRU\Users\,$strip($2),.ini),SEEN,LAST),$strip($2),$nick)))) set -u1 %L $readini($+(SRU\Users\,$replace(%2,[,@,],~,|,-),.ini),$iif($strip($3) == CHAN,$+($network,$chan),TOTAL),Lines) ;*************************************************************************************************************************************************************************************************************************************** if (!$readini($+(SRU\Users\,%2,.ini),SEEN,LAST)) { msg # Sorry $+($mNiCK($nick),...) I've got no date on $mNiCK(%2) $iif(%2 ison $chan,but he/she right here inside $mCHAN(#)) | goto END } ;*********************************************************************************************************************** ;******* User Level / Class ;*** 176400 elseif ($strip(%L) >= $calc(420*420)) { set -u1 %Y 9Class 8Sage | set -u1 %Y+ at least $+(04,$v2,) 14lines 15aka 04420 034209s } ;*** 105000 elseif ($strip(%L) >= $calc(420*250)) { set -u1 %Y 9Class 8Ancient | set -u1 %Y+ at least $+(04,$v2,) 14lines 15aka 04250 034209s } ;*** 42000 elseif ($strip(%L) >= $calc(420*100)) { set -u1 %Y 9Class 8Idol | set -u1 %Y+ at least $+(04,$v2,) 14lines 15aka 04100 034209s } ;*** 21000 elseif ($strip(%L) >= $calc(420*50)) { set -u1 %Y 9Class 8Icon | set -u1 %Y+ at least $+(04,$v2,) 14lines 15aka 0450 034209s } ;*** 12600 elseif ($strip(%L) >= $calc(420*30)) { set -u1 %Y 9Class 8Elite | set -u1 %Y+ at least $+(04,$v2,) 14lines 15aka 0430 034209s } ;*** 8400 elseif ($strip(%L) >= $calc(420*20)) { set -u1 %Y 9Class 14Legend | set -u1 %Y+ at least $+(04,$v2,) 14lines 15aka 0420 034209s } ;*** 6300 elseif ($strip(%L) >= $calc(420*15)) { set -u1 %Y 9Class 15Veteran | set -u1 %Y+ at least $+(04,$v2,) 14lines 15aka 0415 034209s } ;*** 5880 elseif ($strip(%L) >= $calc(420*14)) { set -u1 %Y 9Class 14Meth Lab Manager | set -u1 %Y+ at least $+(04,$v2) 14lines 15aka 0414 034209s } ;*** 5460 elseif ($strip(%L) >= $calc(420*13)) { set -u1 %Y 9Class 15Meth Lab Assistant | set -u1 %Y+ at least $+(04,$v2,) 14lines 15aka 0413 034209s } ;*** 5040 elseif ($strip(%L) >= $calc(420*12)) { set -u1 %Y 9Class 15Thug | set -u1 %Y+ at least $+(04,$v2,) 14lines 15aka 0412 034209s } ;*** 4620 elseif ($strip(%L) >= $calc(420*11)) { set -u1 %Y 9Class 15Saboteur | set -u1 %Y+ at least $+(04,$v2,) 14lines 15aka 0411 034209s } ;*** 4200 elseif ($strip(%L) >= $calc(420*10)) { set -u1 %Y 9Class 3Informant | set -u1 %Y+ at least $+(04,$v2,) 14lines 15aka 0410 034209s } ;*** 3780 elseif ($strip(%L) >= $calc(420*9)) { set -u1 %Y 9Class 3Gang Member | set -u1 %Y+ at least $+(04,$v2,) 14lines 15aka 049 034209s } ;*** 3360 elseif ($strip(%L) >= $calc(420*8)) { set -u1 %Y 9Class 14Gang Recruit | set -u1 %Y+ at least $+(04,$v2,) 14lines 15aka 048 034209s } ;*** 2940 elseif ($strip(%L) >= $calc(420*7)) { set -u1 %Y 9Class 15Thief | set -u1 %Y+ at least $+(04,$v2,) 14lines 15aka 047 034209s } ;*** 2520 elseif ($strip(%L) >= $calc(420*6)) { set -u1 %Y 9Class 15Shoplifter | set -u1 %Y+ at least $+(04,$v2,) 14lines 15aka 046 034209s } ;*** 2100 elseif ($strip(%L) >= $calc(420*5)) { set -u1 %Y 9Class 15Mugger | set -u1 %Y+ at least $+(04,$v2,) 14lines 15aka 045 034209s } ;*** 1680 elseif ($strip(%L) >= $calc(420*4)) { set -u1 %Y 9Class 15Purse Snatcher | set -u1 %Y+ at least $+(04,$v2,) 14lines 15aka 044 034209s } ;*** 1260 elseif ($strip(%L) >= $calc(420*3)) { set -u1 %Y 9Class 15Pickpocket | set -u1 %Y+ at least $+(04,$v2,) 14lines 15aka 043 034209s } ;*** 840 elseif ($strip(%L) >= $calc(420*2)) { set -u1 %Y 9Class 15Civilian 15(8User15) | set -u1 %Y+ at least $+(04,$v2,) 14lines 15aka 042 034209s } ;*** 420 elseif ($strip(%L) >= 420) { set -u1 %Y 9Class 15Civilian 15(8New User15) | set -u1 %Y+ at least $+(04,$v2,) 14lines } ;*** Lower then 420 elseif ($strip(%L) < 420) { set -u1 %Y 9Class 14Scammer 15(8New User15) | set -u1 %Y+ less then $+(04,$v2,) 14lines } ;***************************************************************************************************************************************************** set -u1 %X $iif(!$2,$nick,$iif($strip($2) ison $chan,$nick(#,$nick(#,$v1)),$iif($readini($+(SRU\Users\,$strip($2),.ini),SEEN,LAST),$strip($2),$nick)))) $iif(%Y+,set %Y+ $+(15,$chr(40),14Awarded to users with $v1,15,$chr(41))) set -u1 %I $readini($+(SRU\Users\,%2,.ini),iNFO,iAM) set -u1 %Z $+(9,Last seen $iif($readini($+(SRU\Users\,%2,.ini),SEEN,CHAN) && $readini($+(SRU\Users\,%2,.ini),SEEN,CHAN) != $chan,inside $mCHAN($v1)) $iif($readini($+(SRU\Users\,%2,.ini),SEEN,WHERE) != $network,on $mNetC($v1)),) $& $iif($readini($+(SRU\Users\,%2,.ini),SEEN,DATE) != $day $date(dd/mm/yyyy),like) $mNUM($mReplaceCTiME($readini($+(SRU\Users\,%2,.ini),SEEN,TiME)) ago) $iif($readini($+(SRU\Users\,%2,.ini),SEEN,DATE) != $day $date(dd/mm/yyyy),$mSPACE $+($replace($v1,day,day14,/,15/14),))) $& $iif($readini($+(SRU\Users\,%2,.ini),LAST,$network) && $readini($+(SRU\Users\,%2,.ini),SEEN,WHERE) != $network,$mSPACE Last seen on $mNetC($network) like $mNUM($duration($calc($ctime -$readini($+(SRU\Users\,%2,.ini),LAST,$network))) ago)) ;********************************************************************************************************************************************************************************************************************************************** msg # 9[ $+(03,%X) $+(9],$iif(%I,:[ $+(09,$v1) 9]),:-:[) %Y $replace($remove(%Y+,$chr(41)),$chr(40),$+($mSPACE,$chr(32))) $+(9],$iif(%Z,:[ $+(09,$v1) 9]),) $iif($readini($+(SRU\Users\,%2,.ini),$iif($strip($3) == CHAN,$+($network,$chan),TOTAL),Words),msg # 9Has written $mNUM($v1) 9words $& $+($chr(40),9Avg. $mNUM($round($calc($iif($readini($+(SRU\Users\,%2,.ini),$iif($strip($3) == CHAN,$+($network,$chan),TOTAL),Words) > $readini($+(SRU\Users\,%2,.ini),$iif($strip($3) == CHAN,$+($network,$chan),TOTAL),Characters),$v1 / $v2,$v2 / $v1)),2)),$chr(41)) $& 9in $mNUM($iif($readini($+(SRU\Users\,%2,.ini),$iif($strip($3) == CHAN,$+($network,$chan),TOTAL),Lines),$v1,0)) 9lines $& $+($chr(40),9Avg. $mNUM($round($calc($readini($+(SRU\Users\,%2,.ini),$iif($strip($3) == CHAN,$+($network,$chan),TOTAL),Words) / $readini($+(SRU\Users\,%2,.ini),$iif($strip($3) == CHAN,$+($network,$chan),TOTAL),Lines)),2)),$chr(41)) $& 9with $mNUM($iif($readini($+(SRU\Users\,%2,.ini),$iif($strip($3) == CHAN,$+($network,$chan),TOTAL),Characters),$v1,0)) 9characters... $& $iif($strip($3) == TOTAL,[14STATS] $+($iif($readini($+(SRU\Users\,%2,.ini),$iif($strip($3) == CHAN,$+($network,$chan),TOTAL),Joins),$mNUM($v1) $+(9join,$iif($v1 >= 2,s))) $& $iif($readini($+(SRU\Users\,%2,.ini),$iif($strip($3) == CHAN,$+($network,$chan),TOTAL),Parts),$mNUM($v1) $+(9part,$iif($v1 >= 2,s))) $& $iif($readini($+(SRU\Users\,%2,.ini),$iif($strip($3) == CHAN,$+($network,$chan),TOTAL),Hops),$mNUM($v1) $+(9hop,$iif($v1 >= 2,s))) $& $iif($readini($+(SRU\Users\,%2,.ini),$iif($strip($3) == CHAN,$+($network,$chan),TOTAL),Kicks),$mNUM($v1) 9kicked) $& $iif($readini($+(SRU\Users\,%2,.ini),$iif($strip($3) == CHAN,$+($network,$chan),TOTAL),Banns),$mNUM($v1) 9banned) $& $iif($readini($+(SRU\Users\,%2,.ini),$iif($strip($3) == CHAN,$+($network,$chan),TOTAL),UN-Banns),$mNUM($v1) 9un-banned) $& $iif($readini($+(SRU\Users\,%2,.ini),$iif($strip($3) == CHAN,$+($network,$chan),TOTAL),Modes),$mNUM($v1) $+(9mode,$iif($v1 >= 2,s))) $& $iif($readini($+(SRU\Users\,%2,.ini),$iif($strip($3) == CHAN,$+($network,$chan),TOTAL),uModes),$mNUM($v1) $+(9usermode,$iif($v1 >= 2,s))) $& $iif($readini($+(SRU\Users\,%2,.ini),$iif($strip($3) == CHAN,$+($network,$chan),TOTAL),Topics),$mNUM($v1) $+(9topic,$iif($v1 >= 2,s))) $& $iif($readini($+(SRU\Users\,%2,.ini),$iif($strip($3) == CHAN,$+($network,$chan),TOTAL),Quits),$mNUM($v1) $+(9quit,$iif($v1 >= 2,s))) $& $iif($readini($+(SRU\Users\,%2,.ini),$iif($strip($3) == CHAN,$+($network,$chan),TOTAL),Actions),and $mNUM($v1) $+(9action,$iif($v1 >= 2,s))),))) ;********************************************************************************************************************************************************************************************************************************************** } ;********************************************************************************************************************************************************************************************************************************************** :END ;****** unset %Y %Y+ %I %Z %X %L ;*********************** ;*** LAST SECTiON writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) LAST SEEN $ctime writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) LAST $upper($event) $ctime writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) LAST $network $ctime $iif($chan != $null,writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) LAST $+($network,$chan) $ctime) ;*** SEEN SECTiON .remini $+(SRU\Users\,%TEXT-NiCK,.ini) SEEN writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) SEEN LAST $upper($event) writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) SEEN TiME $ctime writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) SEEN DATE $day $date(dd/mm/yyyy) writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) SEEN WHERE $network $iif($chan != $null,writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) SEEN CHAN $chan) $iif($chan != $null,writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) SEEN NiCK $mReplaceNiCK($nick)) ;************************************************************************************************* if ($event == PART) || ($event == QUiT) writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) SEEN REASON $iif($event == QUiT,$iif($3,$strip($3-),QUiT),$iif($event == PART,$iif($1,$strip($1-),N/A))) ;************************************************************************************************* writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) SEEN DOiNG $upper($event) $iif($event == QUiT,$iif($3,$strip($3-),QUIT),$iif($event == PART,$iif($1,$strip($1-),N/A),$iif($event == BAN,$bnick,$iif($event == UNBAN,$bnick,$iif($event == KiCK,$knick $strip($1-),$strip($1-)))))) ;****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** if ($event == ACTiON) && ((rape isin $strip($1)) || (molest isin $strip($1)) || (fark isin $strip($1)) || (SCREW isin $strip($1)) || (slap isin $strip($1)) || (thank isin $strip($1)) || (swaffel isin $strip($1))) { writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) SEEN ACTiON $v1 $iif($remove($strip($2),:,>,<,!,?) ison $chan,writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) SEEN ViCTiM $nick(#,$nick(#,$v1))) } ;************************************************************************************************************ elseif ($event == TEXT) && ((!SEEN isin $strip($1)) || (!iDLE isin $strip($1)) || (!PiNG isin $strip($1)) || (!USER isin $strip($1)) || (!U isin $strip($1)) || (!IRCStats isin $strip($1))) { writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) SEEN ACTiON $iif($1 != !U,$remove($v1,!),USER) writeini -n $+(SRU\Users\,%TEXT-NiCK,.ini) SEEN ViCTiM $iif($remove($strip($2),:,>,<,!,?) ison $chan,$nick(#,$nick(#,$v1)),$iif(!$2,$nick,$remove($strip($2),:,>,<,!,?))) } ;*********************************************************************************************************************************************************** unset %TEXT-NiCK %Event-NiCK }
  20. chain

    Blackjack Race

    Blackjack Race is a channel based multiplayer game, supporting up to your standard 7 players. I saw a few versions of Blackjack on this site, but none of them were scripted well, whether it be the style of code, the game pace or the logic within the code to match the game. So here you go 🙂 Features include: Simultaneous games within multiple channels at the same time A "first to" style, meaning rather than betting, you're trying to accumulate a certain amount of coins to win Derived from the real casino game, but adapted to suit IRC A real shoe, with shuffling points when shoe density falls below a threshold Accurate dealer simulation, standing with hard 17 Strategy play options: !hit !stand !double !split !surrender Resplit as many times as you require! 10 seconds are added to the timer for each "layer" of hands all players go through The Edge - An optional lower boundary which kicks players from the game when overstepped AI opponents, with an intelligence range from 1 to 10 Automatic AI participation if only 1 player joins Easily configure options and house rules within the script No messy global variables Possibility to save statistics via external files To start a game, type !blackjack To join a game, type !join To start a game with AI opponents ready to join, type !blackjack N, where N is a number from 1 to 7 To start a game with specific AI opponents, for example Jess and Kyle, type !blackjack Jess Kyle To leave a game type !replace. This will replace you with an AI opponent To view a list of AI opponents and their intelligence level, type !ai To forcefully stop a game, type !blackjack stop OR !stop (Operators only) To abort the games termination, type !abort To view a list of ALL commands, type !commands ;######################################################## ;######################################################## ; SETTINGS (for YOU.... yes YOU!!!) ;######################################################## ;######################################################## ;# THE DEALER HAS AN EDGE. If you win as much as you lose, all player balances will gradually decrease making the 'finish' impossible to reach. ;# to compensate, you can award points for draws, and reward more money for a win than you take away for a loss. The same applies for doubles. ;# for faster games: 200 40 20 30 0 -10 5 10 -3 ;# more realistic game values: 150 40 20 30 -10 -25 0 0 -5 alias -l finish return 150 alias -l winDouble return 40 alias -l winSingle return 20 alias -l winBlackjack return 30 alias -l loseSingle return -10 alias -l loseDouble return -25 alias -l drawSingle return 0 alias -l drawDouble return 0 alias -l surrender return -5 ;# theEdge - Set to 0 to disable. Kicks players from the game after falling below -N alias -l theEdge return -100 ;# Bonus payouts. N card tricks represent an auto-payout if a player's hand consists of N cards. set to 0 to disable, otherwise set to the amount which should be paid out. alias -l var5CardTrickPayout return 5 alias -l var6CardTrickPayout return 10 alias -l var7CardTrickPayout return 15 alias -l var5Card21Payout return 20 alias -l var6Card21Payout return 40 alias -l var7Card21Payout return 100 ;# House rules. 'decks' can be from 2-8. The other lines respresent rules which can be used in the game. To "activate" a rule, change the 0 to a 1. alias -l decks return 2 alias -l dealerHitsOnSoft17 return 0 alias -l doubleWith3orMoreCards return 0 alias -l noResplitWithAces return 0 alias -l splitAcesOneCardOnly return 0 ;# Colors. 3 are used, each represented below. Use 2 digits, from 00-15 alias -l color1 return 07 alias -l color2 return 03 alias -l color3 return 06 ;# AI opponents. Just seperate the names by spaces, if you want to add more. ;# the intelligence levels correlate to the names, so Jess matches 6 and Kyle matches the last 1. alias -l ai return Jess Trump DeathKnight AIMaster Jerry Lacey Jonorama Degausser NotTheSun Kyle alias -l aiIntel return 6 9 8 10 3 5 4 7 2 1 ;# 'statEnable' signifies whether the statistics will be recorded. 1 represents on, and 0 off ;# 'statDirectory' is your path to stats. there should be no slashes at the beginning or end of the path. use \ if you want to go deeper into folders ;# the other two aliases represent the minimum needed hands/games for a user to be displayed in the top5 lists alias -l statEnable return 1 alias -l statDirectory return stats\blackjack alias -l statMinHands return 10 alias -l statMinGames return 2 ;######################################################## ;######################################################## ; TEXT EVENTS ;######################################################## ;######################################################## on *:TEXT:*:#:{ if ($hget($g($chan,1))) { if ($hget($g($chan,1), $nick)) && ($hget($g($chan,1), $nick) != check) && (!$isAI($chan, $nick)) { if ($timer($+(BlackJack,$chan,DrawTimer))) { if ($1 == !hit) || ($1 == !card) drawCardAction $chan $nick elseif ($1 == !double) drawCardAction $chan $nick -d elseif ($1 == !stand) standAction $chan $nick elseif ($1 == !split) splitAction $chan $nick elseif ($1 == !surrender) surrenderAction $chan $nick } if ($1 == !replace) || ($1 == !drop) replaceAction $chan $nick } elseif ($istok(!join.join,$1,46)) && ($timer($+(BlackJack,$chan,JoinTimer))) addPlayer $chan $nick if ($1-2 == !blackjack stop) || ($1 == !stop) triggerBlackjackStop $chan -m $nick elseif ($1 == !abort) && ($hget($s($chan), stop)) triggerAbort $1- elseif ($1 == !repair) && ($nick isop $chan) triggerRepair $chan } elseif ($1 == !blackjack) triggerBlackjack $1- if ($1 == !stat) triggerStats stat $1- elseif ($1 == !coins) triggerStats coins $1- elseif ($1 == !commands) triggerCommands $1- elseif ($1 == !top5) triggerTop5 $1- elseif ($1 == !compare) triggerCompare $1- elseif ($1 == !ai) .notice $nick List of computer opponents: $listAI } ;######################################################## ;######################################################## ; LITTLE ALIASES ;######################################################## ;######################################################## alias -l suits return ♣♠♥♦ alias -l cardify return $replace($1-,10,E,11,J,12,Q,13,K,1,A,E,10) alias -l bracks return $+($chr(40),$1-,$chr(41)) alias -l cb1 return $+(,$color1,,$1-,) alias -l cb2 return $+(,$color2,,$1-,) alias -l cb3 return $+(,$color3,,$1-,) alias -l c1 return $+(,$color1,$1-,,) alias -l c2 return $+(,$color2,$1-,,) alias -l c3 return $+(,$color3,$1-,,) alias -l f { verif | return $+(",$mircdir,$statDirectory,\,$1,.ini,") } alias -l l { verif | return $+(",$mircdir,$statDirectory,\,$1,.txt,") } alias -l getStat return $iif($readini($1,$2,$3),$ifmatch,0) alias -l fs filter -ffctue 1 32 $1- $1- alias -l top5 return cph.wr.cpg.gr.h2h alias -l g return $+(bj_game,_,$1,_,$2) alias -l a return $+(bj_action,_,$1,_,$2) alias -l d return $+(bj_deck,_,$1) alias -l w return $+(bj_score,_,$1) alias -l s return $+(bj_settings,_,$1) alias -l hfreedom { if ($hget($g($1,1))) hfree $g($1,1) if ($hget($a($1,1))) hfree $a($1,1) if ($hget($d($1))) hfree $d($1) if ($hget($w($1))) hfree $w($1) if ($hget($s($1))) hfree $s($1) hfreedomMirror $1 } alias -l hfreedomMirror { var %x = 2 while ($hget($g($1,%x))) { hfree $hget($g($1,%x)) hfree $hget($a($1,%x)) inc %x } } alias -l verif { if (!isdir($+(",$mircdir,$statDirectory,\,"))) { var %x = 1 while (%x <= $numtok($statDirectory,92)) { if (!isdir($+(",$mircdir,$gettok($statDirectory,$+(1-,%x),92),\,"))) .mkdir $+(",$mircdir,$gettok($statDirectory,$+(1-,%x),92),\,") inc %x } } } ;######################################################## ;######################################################## ; GAME TRIGGERS ;######################################################## ;######################################################## alias triggerBlackjack { if (!$2) blackjackStart $chan $nick elseif ($istok(1.2.3.4.5.6.7,$2,46)) blackjackStart $chan $nick $2 elseif ($filterAI($2-)) blackjackStart $chan $nick $ifmatch else { .notice $nick Invalid parameter. To start a game with AI opponents ready to join, type !blackjack N. N can be a number from 1-7 .notice $nick You can also specify certain AI opponents you want in the game, for example: !blackjack AIMaster Degausser Trump } } alias triggerBlackjackStop { if ($3 !isop $1) .notice $3 You must be an operator to stop a game! else { if ($cardsRemaining($1)) { if (!$hget($s($1), stop)) stopAction $1 $3 else .notice $3 The game will end after the current round! } elseif ($timer($+(BlackJack,$1,JoinTimer))) { $+(.timerBlackJack,$chan,*) off if ($2 == -m) msg $chan $cb3(Blackjack Race) has been stopped by $c3($3) hfreedom $1 } else .notice $3 You can't perform this action now! } } alias -l triggerAbort { if ($timer($+(BlackJack,$chan,DrawTimer))) && ($nick isop $chan) abortAction $chan $nick elseif ($nick !isop $chan) .notice $nick You must be an operator to abort the games termination! else .notice $nick You can't perform that action now } alias -l triggerStats { if (!$3) .notice $nick Invalid parameters. Specify a name. The -a flag can be used to specify an AI character like: $+(!,$1) -a Degausser elseif (((!$4) && (!$userStats($3))) || (($4) && (!$userStats($4)))) || (($1 == coins) && ((!$userStats($4).user) && (!$userStats($3).user))) .notice $nick Sorry, I haven't heard that name before else { var %s if (!$4) %s = $chan -u $3 elseif ($3 == -a) && ($userStats($4).ai) && ($1 != coins) %s = $chan -a $4 else %s = $chan -u $4 if ($1 == stat) displayStats %s elseif ($1 == coins) displayCoins %s } } alias -l triggerCommands { if ($istok(!ai.ai,$2,46)) .notice $nick This will send you a notice with a list of AI opponents you're able to play against elseif ($istok(!stat.stat,$2,46)) .notice $nick These will send a message with user statistics for the specified name. You can specify the -a flag to define AI opponents, such as: !stat -a Degausser elseif ($istok(!coins.coins,$2,46)) .notice $nick These will send a message with total user coins. Define a user (not AI) by simply specifying a username. elseif ($istok(!commands.commands,$2,46)) .notice $nick This will notice you a list of commands.... silly! elseif ($istok(!compare.compare,$2,46)) { .notice $nick Compare two players based on their stats in comparison to all other players. You can specify two names, and optionally a -a or -u before the names to specify AI or user .notice $nick For example, !compare Anne -a Degausser. Example 2: !compare -a Kyle -u Sarah } elseif ($istok(!blackjack.blackjack,$2,46)) { .notice $nick This command will start a game. You can specify the number of AI opponents ready to join by typing !blackjack N, where N is a number from 1-7 .notice $nick You can also specify specific players by using their names (type !ai for a list) like so: !blackjack Degausser NotTheSun .notice $nick If a game is active, channel operators can end the game by typing: !blackjack stop } elseif ($istok(!replace.replace,$2,46)) .notice $nick Specifically an in-game command to be used if you don't want to play anymore. The game will be counted as a loss elseif ($istok(!top5.top5,$2,46)) { .notice $nick Displays lists of top 5 players. You can specify a -a or -u flag to view distinct AI or user lists. You can also specify the type of list from: $replace($top5,$chr(46),$chr(32)) .notice $nick Example 1: !top5 -u wr :: Example 2: !top5 cph } elseif ($istok(!abort.abort,$2,46)) { .notice $nick Allows you to abort the !blackjack stop operation, before a hand finishes } elseif ($istok(!stop.stop,$2,46)) { .notice $nick Stops the entire round. Does not apply game based statistics } elseif ($istok(!repair.repair,$2,46)) { .notice $nick Repairs the game if you're having trouble starting a new game } else { .notice $nick Helpful commands - IN GAME: !hit !stand !double !split !surrender !replace !stop !abort !repair - OUTSIDE: !blackjack !commands !ai !stat !coins !top5 !compare .notice $nick Type !commands command for more information on some commands, for example: !commands ai } } alias -l triggerTop5 { var %t = $gettok($top5,1,46) if (!$3) { if ($istok(-a.-u,$2,46)) displayTop5 $chan $2 %t else displayTop5 $chan -n $iif($istok($top5,$2,46),$2,%t) } elseif ($left($2,1) == $chr(45) && $len($2) == 2) displayTop5 $chan $iif($istok(-a.-u,$2,46),$2,-n) $iif($istok($top5,$3,46),$3,%t) elseif ($2) displayTop5 $chan -n $iif($istok($top5,$2,46),$2,%t) else displayTop5 $chan -n %t } alias -l triggerCompare { if ($0 == 3) { if ($userStats($2)) && ($userStats($3)) displayCompare -u $2 -u $3 $chan else .notice $nick One of more of the specified users could not be found } elseif ($0 == 5) { if ($userStats($3)) && ($userStats($5)) displayCompare $iif($2 == -a,-a,-u) $3 $iif($4 == -a,-a,-u) $5 $chan else .notice $nick One of more of the specified users could not be found } elseif ($0 < 3) .notice $nick You have to specify two users to compare them. Type !compare player1 player2 elseif ($0 > 5) .notice $nick You've specified to many parameters! To specify users or AI, type: !compare -u user -a AIname else { if ($userStats($3)) { if ($userStats($4)) displayCompare $iif($2 == -a,-a,-u) $3 -u $4 $chan elseif ($userStats($2)) displayCompare -u $2 $iif($4` == -a,-a,-u) $3 $chan } elseif ($userStats($2)) && ($userStats($4)) displayCompare -u $2 $iif($3 == -a,-a,-u) $4 $chan else .notice $nick One or more of the specified users are not recognized } } alias -l triggerRepair { if (!$timerCheck($1)) { msg $1 $cb3(Blackjack Race) was found in a $c2(broken state) $+ , and has been $c3(repaired) hfreedom $1 } } alias -l timerCheck { if ($timer($+(blackjack,$1,DrawTimer)).secs isnum) return $true if ($timer($+(blackjack,$1,JoinTimer)).secs isnum) return $true if ($timer($+(blackjack,$1,AutoTimer)).secs isnum) return $true if ($timer($+(blackjack,$1,RepeatGame)).secs isnum) return $true if ($timer($+(blackjack,$1,NextRound)).secs isnum) return $true if ($timer($+(blackjack,$1,AnnounceWinner)).secs isnum) return $true if ($timer($+(blackjack,$1,EndGame)).secs isnum) return $true return $false } ;######################################################## ;######################################################## ; ACTIONS ;######################################################## ;######################################################## alias -l drawCardAction { if ($numerifyTotal($cardTotal($1,-u,$2).hard) < 21) && (!$istok(double.stand, $hget($a($1,1), $2), 46)) { var %d = $iif(d isin $3,$true,$false) if ((%d) && ($numtok($hget($g($1,1), $2), 32) > 2)) && (!$doubleWith3orMoreCards) .notice $nick You can only double with the first two cards! else { var %card = $drawCard($1), %z hadd $g($1,1) $2 $hget($g($1,1), $2) %card %z = $numerifyTotal($cardTotal($1,-u,$2).hard) if (%z > 20) && (!%d) hadd $a($1,1) $2 stand else hadd $a($1,1) $2 $iif(%d,double,hit) msg $1 $c2($2) $iif(%d,doubled,hit) and drew: $cardflair(%card) :: Current hand: $cardflair($hget($g($1,1), $2)) $bracks($cardTotal($1,-u,$2)) if (%z == 21) && ($($+($chr(36),var,$numtok($hget($g($1,1),$2),32),Card21Payout),2)) { hinc $w($1) $2 $ifmatch msg $1 $c1($2) has hit a $cb3($numtok($hget($g($1,1),$2),32) Card 21) and is rewarded $c2($ifmatch coins) } elseif (%z < 21) && ($($+($chr(36),var,$numtok($hget($g($1,1),$2),32),CardTrickPayout),2)) { hinc $w($1) $2 $ifmatch msg $1 $c1($2) has hit a $cb3($numtok($hget($g($1,1),$2),32) Card Trick) and is rewarded $c2($ifmatch coins) } if ((%d) || (%z > 20)) { hinc $s($1) completed 1 if ($splitHand($1,$2)) createSplits $1 $2 $ifmatch elseif ($actionsComplete($1)) checkWinner $1 -f } } } else .notice $2 You can't draw anymore cards! } alias -l standAction { if ($numerifyTotal($cardTotal($1,-u,$2).hard) < 21) && (!$istok(double.stand, $hget($a($1,1), $2), 46)) { hadd $a($1,1) $2 stand hinc $s($1) completed 1 msg $1 $c2($2) stands with the hand: $cardflair($hget($g($1,1), $2)) $bracks($cardTotal($1,-u,$2)) if ($splitHand($1,$2)) createSplits $1 $2 $ifmatch elseif ($actionsComplete($1)) checkWinner $1 -f } else .notice $2 You can't perform this action! } alias -l splitAction { var %hand = $hget($g($1,1),$2) if ($cardPair(%hand)) && (!$istok(double.stand,$hget($a($1,1),$2),46)) { if ($noResplitWithAces) && ($gettok($gettok(%hand,1,32),2,95) == A) && ($hget($g($1,2),$2)) .notice $2 You can't split Aces more than once! else { msg $1 $c2($2) splits the hand: $cardflair($hget($g($1,1),$2)) $bracks($cardTotal($1,-u,$2)) hadd $newSplitTable($1,$2) $2 $gettok($hget($g($1,1),$2),2,32) hadd $g($1,1) $2 $gettok($hget($g($1,1), $2),1,32) hinc $s($1) actions 1 createSplits $1 $2 } } else .notice $2 You can't perform this action! } alias -l surrenderAction { if ($numtok($hget($g($1,1), $2), 32) == 2) && ($numerifyTotal($cardTotal($1,-u,$2).hard) < 21) && (!$hget($m($1,1),$2)) && (!$istok(double.stand, $hget($a($1,1), $2), 46)) { msg $1 $c2($2) surrenders their hand: $cardflair($hget($g($1,1), $2)) $bracks($cardTotal($1,-u,$2)) and $c1($iif($surrender > 0,wins,loses) $abs($surrender) $iif($abs($surrender) == 1,coin,coins)) hdel $a($1,1) $2 hadd $g($1,1) $2 check hinc $w($1) $2 $surrender hinc $s($1) completed 1 processHandStats $1 $2 total 1 processHandStats $1 $2 lose 1 processHandStats $1 $2 coins $surrender if ($actionsComplete($1)) checkWinner $1 -f } else .notice $2 You can't perform this action! } alias -l replaceAction { if (!$istok($hget($s($1),replace),$nick,32)) { hadd $s($1) replace $hget($s($1), replace) $2 msg $1 $cb3($2) $c3(will be replaced after the next round!) } } alias -l stopAction { hadd $s($1) stop $2 msg $1 $cb3(Blackjack Race) $c3(will be stopped after the next round!) } alias -l abortAction { if ($hget($s($1),stop)) hdel $s($1) stop msg $1 $cb3(Blackjack Race) $c3(will no longer be stopped after this round!) } alias -l actionsComplete { if ($hget($s($1), completed) == $hget($s($1), actions)) return $true return $false } ;######################################################## ;######################################################## ; SPLIT TABLES ;######################################################## ;######################################################## alias -l newSplitTable { var %x = 2 while (%x) { if (!$hget($g($1, %x))) { hmake $g($1, %x) 1 hmake $a($1, %x) 1 $+(.timerBlackJack,$1,DrawTimer) -o 1 $calc($timer($+(BlackJack,$1,DrawTimer)).secs + 10) checkWinner $1 } if (!$hget($g($1, %x), $2)) return $g($1,%x) inc %x } } alias -l splitHand { var %x = 2 while ($hget($g($1,%x),$2)) { if ($numtok($ifmatch,32) == 1) return %x inc %x } return $false } ;######################################################## ;######################################################## ; THE EDGE ;######################################################## ;######################################################## alias -l offTheEdge { if ($theEdge < 0) { var %x = 1, %n = $hget($w($1),0).item, %p, %s, %e = $v1, %count = 1, %countvar, %minimum, %a while (%x <= %n) { %s = $hget($w($1),%x).data if (!$len(%countvar)) %countvar = %s elseif (%countvar == %s) inc %count if (%s > %minimum) || (!$len(%minimum)) %minimum = %s inc %x } if (%count != %n) { if (%minimum > %e) %minimum = %e %x = 1 while ($len($hget($w($1),%x).item)) { %p = $hget($w($1),%x).item %s = $hget($w($1),%p) if (%s < %minimum) { %a = $iif($isAI($1,%p),-a,-u) msg $1 $cb2(%p) has tipped over $c3(The Edge) and fallen into obscurity! $cb3(Goodbye %p $+ !) preProcessHandStats $1 %p %a lose if (%a == -u) coinSave $1 %p hdel $g($1,1) %p hdel $w($1) %p top5PreWrite $1 %p %a } else { if (%s == %minimum) msg $1 $c2(%p) is on $cb3(The Edge) with $+(04,%s,) coins! inc %x } } } } } ;######################################################## ;######################################################## ; ARTIFICIAL INTELLIGENCE ;######################################################## ;######################################################## alias -l getIntel return $iif($findtok($ai,$1,1,32) <= $numtok($aiIntel,32),$iif($gettok($aiIntel,$findtok($ai,$1,1,32),32) isnum 1-10, $v1, 5),5) alias -l isAI return $istok($hget($s($1), ai),$2,32) alias -l listAI { var %x = 1, %y = $numtok($ai,32), %r, %u while (%x <= %y) { %u = $gettok($ai,%x,32) %r = %r $c2(%u) $c1($bracks($getIntel(%u))) / inc %x } return $left(%r,-1) } alias -l filterAI { var %x = 1, %y = $numtok($1-,32), %return, %a while (%x <= %y) { %a = $gettok($1-,%x,32) if ($istok($ai,%a,32)) && (!$istok(%return,%a,32)) %return = $addtok(%return,%a,32) inc %x } return %return } alias -l generateAI { var %x = 1, %y = $numtok($ai,32), %s, %u, %n = $iif($2- isnum 1-7,$iif($2- <= $numtok($ai,32),$2-,$numtok($ai,32)),$numtok($2-,32)) while (%x <= %n) { if ($2- isnum 1-7) { while ($istok(%s,%u,32) || !%u) { %u = $gettok($ai,$rand(1,$numtok($ai,32)),32) } %s = %s %u } elseif ($istok($ai,$gettok($2-,%x,32),32)) %u = $gettok($2-,%x,32) else %u = $null if (%u) $+(.timerBlackJack,$1,JoinTimer,%u) -o 1 $rand(2,28) addPlayer $1 %u -a inc %x } } alias -l rollAI { var %x = 1, %ai = $hget($s($1), ai), %y = $numtok(%ai, 32), %player while (%x <= %y) { %player = $gettok(%ai,%x,32) if (!$istok(double.stand, $hget($a($1,1), %player), 46)) timeAI $1 %player inc %x } } alias -l performAIAction { if ($timer($+(BlackJack,$1,DrawTimer))) { var %action = stand, %intel = $getIntel($2), %dealer = $cardTotal($1, -d).hard, %hard = $cardTotal($1,-u,$2).hard, %soft = $cardTotal($1,-u,$2).soft, %d = $iif($numtok($hget($g($1,1), $2), 32) == 2 || $doubleWith3orMoreCards,1,0), %s = $iif($cardPair($hget($g($1,1),$2)),$ifmatch,0) if (%s == A) && ($hget($g($1,2),$2)) && ($noResplitWithAces) %s = 0 if (%hard < 12) || (%soft < 8) %action = hit if (%intel > 1) && (%hard < 17) %action = hit if (%intel > 1) && (%s) && (%soft == 2) %action = split if (%intel > 2) && (%dealer < 11) && (%hard isnum 10-11) %action = double if (%intel > 2) && (%dealer > 6) && ((%soft > 7) && (%hard > 13)) %action = stand if (%intel > 3) && (%dealer isnum 2-6) && (%hard > 11) && (%soft > 7) %action = stand if (%intel > 3) && (%s) && (%hard == 16) && (%dealer < 11) %action = split if (%intel > 4) && (%dealer isnum 2-3) && (%hard < 14) && (!$istok(double.split,%action,46)) %action = hit if (%intel > 4) && (%dealer > 6) && ((%hard < 15) || (%soft < 8) && (!$istok(double.split,%action,46))) %action = hit if (%intel > 5) && (%dealer == 9) && (%soft < 9) && (%action != split) %action = hit if (%intel > 5) && (%dealer isnum 10-11) && (%soft == 8) %action = hit if (%intel > 5) && (%s) && (%dealer isnum 3-6) && ($istok(4.6.12.14.18,%hard,46)) %action = split if (%intel > 6) && (%dealer == 10) && (%hard isnum 10-11) %action = hit if (%intel > 6) && (%dealer == 9) && (%hard isnum 10-11) %action = double if (%intel > 6) && (%dealer == 11) && (%hard < 17) && (%soft > 2) %action = hit if (%intel > 7) && (%dealer == 3) && (%hard == 13) && (%soft == 13) %action = stand if (%intel > 7) && (%dealer > 7) && (%hard isnum 12-16) && (!$istok(double.split,%action,46)) %action = hit if (%intel > 7) && (%s) && (%dealer == 2) && (%hard isnum 4-6) %action = split if (%intel > 7) && (%s) && (%dealer == 7) && ($istok(4.6.14.16,%hard,46)) %action = split if (%intel > 8) && (%dealer isnum 3-6) && (%hard == 9) %action = double if (%intel > 8) && (%dealer isnum 5-6) && (%soft isnum 2-8) && (%hard > 11) %action = $iif(!%d && %soft == 8,stand,double) if (%intel > 8) && (%dealer == 7) && (%hard isnum 15-16) && (%action != split) %action = hit if (%intel > 8) && (%s) && (%hard == 18) && ($istok(4.5.6.8.9,%dealer,46)) %action = split if (%intel > 9) && (%dealer == 4) && (%soft isnum 5-8) && (%hard > 11) && (%action != split) %action = $iif(!%d && %soft == 8,stand,double) if (%intel > 9) && (%dealer == 3) && (%soft isnum 7-8) && (%hard > 11) && (%action != split) %action = $iif(!%d && %soft == 8,stand,double) if (%action == hit) || ((%action == double) && (!%d)) drawCardAction $1 $2 elseif (%action == double) drawCardAction $1 $2 -d elseif (%action == split) splitAction $1 $2 else standAction $1 $2 if (!$istok(double.stand, $hget($a($1,1), $2), 46)) timeAI $1 $2 } } alias -l timeAI { $+(.timerBlackJack,$1,DrawTimer,$2) -o 1 $rand(2,7) performAIAction $1 $2 } ;######################################################## ;######################################################## ; SHOE MANAGEMENT ;######################################################## ;######################################################## alias -l createDeck { var %i = 1, %d = $calc($hget($s($1), decks) * 52) while (%i <= %d) { hadd $d($1) %i 1 inc %i } } alias -l cardsRemaining return $hget($d($1), 0).item alias -l drawCard { if (!$cardsRemaining($1)) checkShuffle $1 var %r = $rand(1,$cardsremaining($1)), %t = $hget($d($1), %r).item hdel $d($1) %t return $+($mid($suits,$calc((%t % 4) + 1),1),_,$cardify($calc((%t % 13) + 1))) } ;######################################################## ;######################################################## ; GAME FLOW ;######################################################## ;######################################################## alias -l blackjackStart { hfreedom $1 hmake $g($1,1) 1 hmake $a($1,1) 1 hmake $d($1) $floor($calc(($iif($decks isnum 1-8,$v1,2) * 52) / 10)) hmake $w($1) 1 hmake $s($1) 1 hadd $s($1) decks $iif($decks isnum 1-8,$v1,2) hadd $s($1) stats $iif($statEnable,1,0) msg $1 $c2($2) has started a game of $cb3(Blackjack Race!) Type $c2(!join) to join the game, you have $c1(30 seconds!) $+(.timerBlackJack,$1,JoinTimer) -o 1 30 startGame $1 if ($3) generateAI $1 $3- } alias -l addPlayer { if (!$hget($g($1,1), $2)) { hadd $g($1,1) $2 check hadd $w($1) $2 0 if ($3) && (a isin $3) hadd $s($1) ai $iif($hget($s($1), ai),$ifmatch $2,$2) msg $1 $c2($2) $+ $iif(($3) && (a isin $3),$+($chr(32),$bracks(AI level $getIntel($2)))) has joined the game! $c1($players($1)) players joined! $iif($hget($g($1,1), 0).item < 7 && $timer($+(BlackJack,$1,JoinTimer)).secs > 1,You've $c1($timer($+(BlackJack,$1,JoinTimer)).secs) seconds left to join!) if ($hget($g($1,1), 0).item > 6) startGame $1 -f } } alias -l startGame { $+(.timerBlackJack,$1,JoinTimer*) off if (!$players($1)) { msg $1 Nobody has joined the game. $c2(1 player) is required! Turning off. blackjackStop $1 -f } else { if ($players($1) == 1) { while ($players($1) < 2) { if (($isAI($1, $hget($g($1,1), 1).item)) && ($numtok($ai,32) < 2)) || (!$ai) addPlayer $1 $+(Agent,$rand(11111,99999)) -a else addPlayer $1 $gettok($ai,$rand(1,$numtok($ai,32)),32) -a } } hadd $s($1) original_players $players($1) createDeck $1 var %text = The aim is to win $cb1($finish coins) from the $c2(Dealer) before everyone else. Bet amounts are in units of $winSingle $+ , $cb3($iif($hget($s($1), decks) > 1,$v1 decks,1 deck)) in use. Get ready... if ($2) && (f isin $2) msg $1 There are a maximum of $c1($players($1) players!) %text else msg $1 $c1(Time is up!) There are $c1($players($1) players!) %text $+(.timerBlackJack,$1,RepeatGame) -o 1 10 startRound $1 } } alias -l startRound { createDefaults $1 if ($actionsComplete($1)) $+(.timerBlackJack,$1,AutoTimer) -o 1 2 checkWinner $1 -f else { $+(.timerBlackJack,$1,DrawTimer) -o 1 30 checkWinner $1 if ($hget($s($1), ai)) rollAI $1 } } alias -l createDefaults { var %x = 1, %p = $players($1), %player, %actions hadd $s($1) dealer $drawCard($1) hadd $s($1) actions $hget($g($1,1),0).item hadd $s($1) completed 0 while (%x <= %p) { %player = $hget($g($1,1), %x).item hadd $g($1,1) %player $drawCard($1) $drawCard($1) %actions = $iif($numerifyTotal($cardTotal($1,-u,%player).hard) < 21,hit,stand) hadd $a($1,1) %player %actions if (%actions == stand) hinc $s($1) completed 1 msg $1 $c2($+(%player,:)) Your cards are: $cardflair($hget($g($1,1), %player)) :: Total: $bracks($cardTotal($1,-u,%player)) $iif(%actions == hit,:: You can: !hit !stand !double $+ $iif($cardPair($hget($g($1,1), %player)),$+($chr(32),!split))) $+ $iif(%actions == hit,$+($chr(32),!surrender))) inc %x } msg $1 The $cb2(Dealer) is showing: $cardflair($hget($s($1), dealer)) } alias -l createSplits { if ($3) { var %temp = $hget($g($1,1),$2) hadd $g($1,1) $2 $hget($g($1,$3),$2) hadd $g($1,$3) $2 %temp hadd $a($1,$3) $2 $hget($a($1,1),$2) } hadd $g($1,1) $2 $hget($g($1,1),$2) $drawCard($1) var %one = $iif(($splitAcesOneCardOnly) && ($gettok($gettok($hget($g($1,1),$2),1,32),2,95) == A),1,0), %actions = $iif($numerifyTotal($cardTotal($1,-u,$2).hard) < 21 && !%one,hit,stand) hadd $a($1,1) $2 %actions msg $1 $c2($+($2,:)) Your cards are: $cardflair($hget($g($1,1), $2)) :: Total: $bracks($cardTotal($1,-u,$2)) $iif(%actions == hit && !%one,:: You can: !hit !stand !double $+ $iif($cardPair($hget($g($1,1), $2)) && (($cardPair($hget($g($1,1), $2)) != A) || (!$noResplitWithAces)),$+($chr(32),!split))) if (%actions == stand) { hinc $s($1) completed 1 if ($splitHand($1,$2)) forwardSplitter $1 $2 $splitHand($1,$2) elseif ($actionsComplete($1)) checkWinner $1 -f } } alias -l forwardSplitter { createSplits $1- } alias -l blackjackStop { if ($hget($s($1),stats)) { var %x = 1, %f, %u, %p = $players($1), %w, %winner = $3 while ($hget($g($1,1), %x).item) { %u = $ifmatch %f = $iif($isAI($1,%u),-a,-u) %w = $iif(%winner && ($2 != -f),$iif(%winner == %u,win,lose),draw) preProcessHandStats $1 %u %f %w top5PreWrite $1 %u %f if (%f == -u) coinSave $1 %u inc %x } top5Sort } hfreedom $1 } ;######################################################## ;######################################################## ; POST HAND ;######################################################## ;######################################################## alias -l checkWinner { $+(.timerBlackJack,$1,DrawTimer,*) off var %dealer = $dealerOption($1) dealerDraw $1 %dealer roundDisplay $1 %dealer $iif($2,$2) } alias -l roundDisplay { var %t = $hget($s($1), dealer), %win = $getWinner($1).win, %draw = $getWinner($1).draw, %lose = $getWinner($1).lose, %finished = $cb1($iif(f isin $3,All hands are finished!,Time is up!)) var %displaywin = $formatPlayers($1, %win).win, %displaylose = $formatPlayers($1, %lose).lose, %displaydraw = $formatPlayers($1, %draw).draw if ($istok(1.2,$2,46)) msg $1 %finished The $cb2(Dealer) shows $cardflair($gettok(%t,1,32)) and $iif($2 = 2,draws the following cards:,drew the card:) $cardflair($gettok(%t,2-,32)) :: Total: $cb2($cardTotal($1, -d).hard) elseif ($2 == 0) msg $1 %finished Everyone went $c1(bust) so the $cb2(Dealer) wins elseif ($2 == 4) msg $1 %finished Everyone $c1(surrendered) so the $cb2(Dealer) doesn't draw cards else msg $1 %finished The $cb2(Dealer) can't make $c1(Blackjack) so doesn't draw cards if (%win) msg $1 $c1($iif($numtok(%win, 32) != 1,$v1 players,%win)) beat the dealer $+ $iif($numtok(%win, 32) != 1,: %displaywin,: $gettok(%displaywin,2-,32)) if (%draw) msg $1 $c1($iif($numtok(%draw, 32) != 1,$v1 players,%draw)) managed to draw $+ $iif($numtok(%draw, 32) != 1,: %displaydraw,: $gettok(%displaydraw,2-,32)) if (!%win) && (!%draw) && (%lose) && ($istok(1.2,$2,46)) msg $1 The $cb2(Dealer) beat everyone with: $cardflair(%t) :: Total: $cb2($cardTotal($1,-d).hard) $+(.timerBlackJack,$1,nextRound) -o 1 2 nextRound $1 } alias -l checkShuffle { var %r = $cardsRemaining($1) if (%r < $calc(($players($1) + 1) * 7)) { msg $1 $cb3(The cards are getting shuffled and reloaded) $bracks($+($round($calc((%r / ($hget($s($1), decks) * 52)) * 100),2),$chr(37)) density) createDeck $1 } else msg $1 $cb3(%r cards) remain in the shoe $bracks($+($round($calc((%r / ($hget($s($1), decks) * 52)) * 100),2),$chr(37)) density) } alias -l nextRound { msg $1 Current scores: $allScores($1) offTheEdge $1 if ($overallWinner($1)) { var %winner = $ifmatch, %coins = $hget($w($1), %winner) $+(.timerBlackJack,$1,announceWinner) -o 1 2 msg $1 Okay we have an $cb3(overall winner.) $cb2(%winner) wins the game, finishing with $c1(%coins coins!) $+(.timerBlackJack,$1,endGame) -o 1 4 blackjackStop $1 -m %winner } elseif ($hget($s($1), stop)) { $+(.timerBlackJack,$1,announceStop) -o 1 2 msg $1 $cb3(Blackjack Race) was set to be stopped by $c2($hget($s($1), stop)) and has been terminated $+(.timerBlackJack,$1,endGame) -o 1 4 blackjackStop $1 -f } else { hdel -w $a($1,1) * hfreedomMirror $1 $+(.timerBlackJack,$1,ShuffleTimer) -o 1 5 checkShuffle $1 if ($hget($s($1),replace)) $+(.timerBlackJack,$1,ReplaceUser) -o 1 10 replaceUser $1 $+(.timerBlackJack,$1,RepeatGame) -o 1 12 startRound $1 } } alias -l replaceUser { var %x = 1, %u = $hget($s($1),replace), %y = $numtok(%u,32), %user, %a hdel $s($1) replace while (%x <= %y) { %user = $gettok(%u,%x,32) if ($hget($g($1,1), %user)) { while (!%a) || ($hget($g($1,1), %a)) { %a = $iif($rand(1,20) == 1,$+($chr(74),$chr(109),m,$chr(105),$chr($+(10,1))),$+(Agent,$rand(10000,99999))) } preProcessHandStats $1 %user -u lose top5PreWrite $1 %user -u coinSave $1 %user hadd $g($1,1) %a $hget($g($1,1),%user) hadd $w($1) %a $hget($w($1),%user) hdel $g($1,1) %user hdel $w($1) %user hadd $s($1) ai $iif($hget($s($1), ai),$ifmatch %a,%a) msg $1 $cb3(%a) replaces $c2(%user) and joins the game! } inc %x } } ;######################################################## ;######################################################## ; CARD FUNCTIONS ;######################################################## ;######################################################## alias -l numerifyTotal { if ($1- == TOO MANY) return 30 if ($1- == BLACKJACK) return 22 return $1- } alias -l cardflair { tokenize 32 $1- var %x = 1 ,%s ,%d while ($eval($+($,%x),2)) { %d = $remove($ifmatch,_) %s = %s $iif($left(%d,1) isin $left($suits,2),%d,$+(04,%d,)) inc %x } return %s } alias -l cardPair { if ($gettok($gettok($1-,1,32),2,95) == $gettok($gettok($1-,2-,32),2-,95)) return $v1 return $false } alias -l cardTotal { var %s = $iif($2 == -u,$hget($g($1,1), $3),$iif($2 == -d,$hget($s($1), dealer),$2-)), %x = 1, %c = $numtok(%s, 32), %return = 0, %n, %soft = 0 while (%x <= %c) { %n = $replace($gettok($gettok(%s,%x,32),2,95),A,1,J,10,Q,10,K,10) inc %return %n if (%n == 1) && (!%soft) && (%return < 12) inc %soft elseif (%soft) && (%return > 11) dec %soft if (%return > 21) return TOO MANY inc %x } if (%soft) { if (%return == 11) return $iif(%x == 3,BLACKJACK,21) if (!$prop) return $+(%return,/,$calc(%return + 10)) if ($prop == hard) return $calc(%return + 10) } return %return } alias -l formatPlayers { var %x = 1, %y = $numtok($2-,32), %u, %return, %split = 1, %hand, %i, %c, %d while (%x <= %y) { %u = $gettok($2-,%x,32) %hand = $hget($g($1,%split), %u) if ($dealerVS($1, %hand) == $prop) { if (!%i) { %return = %return %u $+ : $bracks($cardflair(%hand)) / | %i = 1 } else %return = $left(%return,-1) $bracks($cardflair(%hand)) / processHandStats $1 %u total 1 $iif($isAI($1, %u),-a) processHandStats $1 %u $prop 1 $iif($isAI($1, %u),-a) if ($prop == win) && ($numerifyTotal($cardTotal($1, %hand).hard) == 22) { hinc $w($1) %u $winBlackjack processHandStats $1 %u coins $winBlackjack $iif($isAI($1, %u),-a) } else { %d = $iif($hget($a($1,%split),%u) == Double,$v2,Single) %c = $eval($+($,$prop,%d),2) hinc $w($1) %u %c if (%d == Double) processHandStats $1 %u double 1 $iif($isAI($1, %u),-a) processHandStats $1 %u coins %c $iif($isAI($1, %u),-a) } } inc %split if ($hget($g($1,%split), %u)) continue %split = 1 %i = 0 inc %x } return $left(%return,-1) } ;######################################################## ;######################################################## ; DEALER FUNCTIONS ;######################################################## ;######################################################## alias -l dealerOption { var %x = 1, %y = $hget($g($1,1),0).item, %return = 0, %t, %m = 1, %p, %q = 1 while (%x <= %y) { %p = $hget($g($1,1),%x).item if ($hget($g($1,%m),%p) == check) inc %q else { %t = $numerifyTotal($cardTotal($1, $hget($g($1,%m), %p)).hard) if (%t < 22) return 2 elseif (%t == 22) %return = 1 inc %m if ($hget($g($1,%m),%p)) continue } %m = 1 inc %x } if (%return == 1) && (!$istok(10.11,$cardTotal($1,-d).hard,46)) return 3 if (%q < %x) return %return return 4 } alias -l dealerDraw { while ($cardTotal($1,-d).hard < 17) || (($dealerHitsOnSoft17) && ($cardTotal($1,-d).soft < 8)) { if ($istok(0.3.4,$2,46)) break hadd $s($1) dealer $hget($s($1), dealer) $drawCard($1) if ($2 == 1) break } } alias -l dealerVS { var %cards = $numerifyTotal($cardTotal($1,$2-).hard), %dealer = $numerifyTotal($cardTotal($1,-d).hard) if ((%cards < %dealer) && (%dealer < 30)) || (%cards == 30) return lose if (%cards == %dealer) return draw return win } ;######################################################## ;######################################################## ; OTHER FUNCTIONS ;######################################################## ;######################################################## alias -l players return $iif($hget($g($1,1), 0).item, $ifmatch, 0) alias -l getWinner { var %return , %x = 1, %p = $players($1), %player, %split = 1, %h while (%x <= %p) { %player = $hget($g($1,1), %x).item if ($hget($g($1,1),%player) != check) { %h = $hget($g($1, %split), %player) inc %split if ($prop == $dealerVS($1,%h)) %return = $addtok(%return,%player,32) elseif ($hget($g($1,%split), %player)) continue %split = 1 } inc %x } return %return } alias -l allScores { var %return, %x = 1, %y = $hget($w($1), 0).item, %s while (%x <= %y) { %s = $hget($w($1), %x).data %return = %return $hget($w($1), %x).item $+ : $iif(%s == 0,0,$+(,$iif(%s < 0,04,$iif(%s >= 100,06,03)),%s,)) :: inc %x } return $left(%return, -2) } alias -l overallWinner { var %return, %x = 1, %y = $hget($w($1), 0).item, %score = $finish - 1, %data while (%x <= %y) { %data = $hget($w($1), %x).data if (%data >= %score) { if (%data > %score) %return = $hget($w($1), %x).item else %return = %return $hget($w($1), %x).item %score = %data } inc %x } if (%x == 2) return $hget($w($1), 1).item if ($numtok(%return, 32) == 1) return %return return $false } ;######################################################## ;######################################################## ; STATISTICS WRITE ;######################################################## ;######################################################## alias -l preProcessHandStats { if ($hget($s($1),stats)) { var %p = $hget($s($1),original_players) processHandStats $1 $2 total 1 $3 games processHandStats $1 $2 players %p $3 games processHandStats $1 $2 $4 1 $3 games processHandStats $1 $2 $+($4,_,single) $iif($4 == win,$calc(%p - 1),1) $3 games processHandStats $1 $2 coins $iif($hget($w($1),$2),$ifmatch,0) $3 games } } alias -l processHandStats { if ($hget($s($1),stats)) { var %a = $iif($5 && a isin $5,$true), %z = $iif($6,$6,hands), %f = $iif(%a,$+(%z,_ai),%z) if (!%a) || ($istok($ai,$2,32)) writeini -n $f(%f) $2 $3 $calc($getStat($f(%f),$2,$3) + $4) } } alias -l userStats { if (!$prop) { if ($getStat($f($iif($2,$2,hands)),$1,total)) return $true if ($getStat($f($iif($2,$2,hands_ai)),$1,total)) return $true return $false } if ($prop == ai) return $iif($getStat($f($+($iif($2,$2,hands),_ai)),$1,total),$true,$false) if ($prop == user) return $iif($getStat($f($+($iif($2,$2,hands))),$1,total),$true,$false) } alias -l coinSave { if ($hget($s($1),stats)) { var %new = $iif($hget($w($1),$2),$ifmatch,0) writeini -n $f(coins) $2 coins $calc($getStat($f(coins),$2,coins) + %new) blackjackCoinListener $2 %new $getStat($f(coins),$2,coins) } } alias -l top5Write { var %a = $iif(a isin $2,$true), %f = $iif($istok(cph.wr,$3,46),$f($iif(%a,hands_ai,hands)),$f($iif(%a,games_ai,games))), %data = $top5Data($1,%f,$3), %l if ($len(%data)) { %l = $read($l($3),w,$+(*,$chr(32),$1,$iif(%a,$+($chr(32),-a),$null))) %l = $iif($readn,$ifmatch,0) write $iif(%l,$+(-l,%l)) $l($3) %data $1 $iif(%a,-a,$null) writeini -n %f $1 $3 %data } } alias -l top5Data { if ($istok(cpg.cph,$3,46)) return $round($calc($getStat($2,$1,coins) / $getStat($2,$1,total)),2) if ($3 == h2h) return $+($round($calc(($getStat($2,$1,win_single) / ($getStat($2,$1,win_single) + $getStat($2,$1,lose_single))) * 100),2),$chr(37)) if ($3 == wr) return $round($calc(($getStat($2,$1,win) / ($getStat($2,$1,win) + $getStat($2,$1,lose) + $getStat($2,$1,draw))) * 100),2) var %t = $getStat($2,$1,total) return $round($calc(((($getStat($2,$1,win) * ((%t * ($getStat($2,$1,players) / %t)) / %t)) / %t) / ($getStat($2,$1,players) / %t)) * 100),2) } alias -l top5PreWrite { var %x = 1 if ($hget($s($1),stats)) { if ($istok($ai,$2,32) || (a !isin $3)) { while ($gettok($top5,%x,46)) { top5Write $2 $3 $ifmatch inc %x } } } } alias -l top5Sort { var %x = 1, %l while ($gettok($top5,%x,46)) { %l = $l($ifmatch) if ($exists(%l)) fs %l inc %x } } ;######################################################## ;######################################################## ; STATISTICS DISPLAY ;######################################################## ;######################################################## alias -l displayStats { var %a = $iif((($2 == -a) && $getStat($f(hands_ai),$3,total)) || !$getStat($f(hands),$3,total),$true), %f = $f($+(hands,$iif(%a,_ai))), %f2 = $f($+(games,$iif(%a,_ai))), %x = 1, %c, %g, %h var %t = $getStat(%f,$3,total), %w = $getStat(%f,$3,win), %d = $getStat(%f,$3,draw), %o = $round($calc(($getStat(%f,$3,double) / (%w + $getStat(%f,$3,lose) + %d)) * 100),2) $+ $chr(37) while ($gettok($top5,%x,46)) { %g = $ifmatch %h = $read($l(%g),w,$+(*,$chr(32),$3,$iif(%a,$+($chr(32),-a),$null))) %c = %c $+($upper(%g),:) $c3($ord($iif($readn,$ifmatch,$lines($l(%g))))) $c2(/) inc %x } msg $1 Play stats for $cb1($3 $+ :) Hands: $c3(%t) $c2(/) Wins: $c3(%w) $c2(/) Draws: $c3(%d) $c2(/) CPH: $c3($top5Data($3,%f,cph)) $c2(/) Win Rate: $c3($top5Data($3,%f,wr)) $c2(/) Double Rate: $c3(%o) msg $1 Game stats for $cb1($3 $+ :) Games: $c3($getStat(%f2,$3,total)) $c2(/) Wins: $c3($getStat(%f2,$3,win)) $c2(/) CPG: $c3($top5Data($3,%f2,cpg)) $c2(/) Game Rating: $c3($top5Data($3,%f2,gr)) $c2(/) H2H Tier: $c3($top5Data($3,%f2,h2h)) msg $1 List stats for $cb1($3 $+ :) $gettok(%c,$+(1-,$calc($numtok(%c,32) - 1)),32) } alias -l displayCoins { %f = $f(coins) if ($ini(%f,$3)) msg $1 Total coins for $cb1($3 $+ :) $c3($getStat(%f,$3,coins)) } alias -l displayTop5 { var %x = 1, %f = $l($3), %l = $lines(%f), %c = 0, %r, %f2, %a, %game = $iif($istok(cpg.gr.h2h,$3,46),games,hands), %y = $iif(%game == games,$statMinGames,$statMinHands), %p msg $1 $cb3(Top 5) $c3($iif(a isin $2,robots,$iif(u isin $2,users,players)) for:) $c2($iif($3 == cph,Coins Per Hand,$iif($3 == wr,Win Rate,$iif($3 == cpg,Coins Per Game,$iif($3 == gr,Game Rating,Head to Head Tier))))) $bracks(min %y %game) while (%x <= %l) && (%c < 5) { %r = $read(%f,%x) %p = $gettok(%r,2,32) %a = $iif($gettok(%r,3,32) == -a,$true,$false) %f2 = $f($iif(%a,$+(%game,_,ai),%game)) if ($getStat(%f2,%p,total) >= %y) && ((($2 == -a) && (%a)) || (($2 == -u) && (!%a)) || ($2 == -n)) { inc %c msg $1 $cb1($+(%c,$chr(46))) $c2(%p) $iif(%a,$+($chr(32),$bracks(AI level $getIntel(%p)))) $cb3($bracks($gettok(%r,1,32))) } inc %x } } alias -l displayCompare { var %x = 1, %a1 = $iif((($1 == -a) && ($getStat($f(hands_ai),$2,total))) || (!$getStat($f(hands),$2,total)),$true,$false), %a2 = $iif((($3 == -a) && ($getStat($f(hands_ai),$4,total))) || (!$getStat($f(hands),$4,total)),$true,$false) var %f, %r1, %r2, %t1, %t2 while (%x <= $numtok($top5,46)) { %f = $l($gettok($top5,%x,46)) %r1 = $read(%f,w,$+(*,$chr(32),$2,$iif(%a1,$+($chr(32),-a),$null))) inc %t1 $iif($readn,$ifmatch,$lines(%f)) %r2 = $read(%f,w,$+(*,$chr(32),$4,$iif(%a2,$+($chr(32),-a),$null))) inc %t2 $iif($readn,$ifmatch,$lines(%f)) inc %x } %r2 = $round($calc((%t1 / (%t1 + %t2)) * 100),2) %r1 = $calc(100 - %r2) if (%r1 > %r2) msg $5 $cb1(>>>) $cb2($2) $cb1(<<<) $cb3($+(%r1,$chr(37))) $c1(vs) $+(%r2,$chr(37)) $c2($4) elseif (%r2 > %r1) msg $5 $c2($2) $+(%r1,$chr(37)) $c1(vs) $cb3($+(%r2,$chr(37))) $cb1(>>>) $cb2($4) $cb1(<<<) else msg $5 $cb2($2) $cb3($+(%r1,$chr(37))) $c1(vs) $cb3($+(%r2,$chr(37))) $cb2($4) } ;######################################################## ;######################################################## ; HELPER FUNCTIONS (use outside script) ;######################################################## ;######################################################## ; return coins in coins.ini alias blackjackGetCoins { return $getStat($f(coins),$1,coins) } ; remove coins from coins.ini alias blackjackDelCoins { var %u = $1, %f = $f(coins) writeini -n %f %u coins $calc($getStat(%f,%u,coins) - $iif($2 isnum,$ifmatch,0)) if ($isid) return $getStat(%f,$1,coins) } ;######################################################## ;######################################################## ; ACCUMULATED COINS LISTENER ;######################################################## ;######################################################## ; listener, each time the user accumulates more coins (runs once per user per game played) ; you can 'transport' the coins accumulated to a separate script/file, and/or delete them ; these coins are displayed by the !coins command, removing them will be reflected. ; you can copy new points ($2) to a global/master file which works with your other scripts, if you want ; take note that $2 and $3 can both be negatives, make proper checks to keep things in accordance with the rest of your script alias -l blackjackCoinListener { ; $1 = the username ; $2 = coins added for user after current game ; $3 = new total coins for user ; your commands here: ; example echo after each time coins are added (uncomment to try) ; echo -a $1 finished the game, $iif($2 >= 0,winning,losing) $2 coins, and now has $3 total coins! ; example removing coins just earnt: ; blackjackDelCoins $1 $2 ; example write to a separate file which holds stars collected by users. Each star is worth 20 coins ; also remove N stars worth of coins from the coin bank. ; if ($3 > 0) { ; var %file = stars.ini, %coinsPerStar = 20, %stars = $floor($calc($3 / %coinsPerStar)) ; writeini %file $1 stars $calc($iif($readini(%file,$1,stars),$v1,0) + %stars) ; blackjackDelCoins $1 $calc($3 - ($3 % %coinsPerStar)) ; } ; hint: removing the if statement surrounding the previous 3 commands will hold it's current functionality, ; but will also remove stars from the stars file if the user falls to -20 or less
  21. add into a new remote file in a clean mirc About: this is a multi server multi channel bot, it will provide you with a user system for your channels and protect each user accordingly. to begin youll have too add yourself as botowner and set your bots trigger in the bot type /addowner Your-Nick ** You must be on the same channel and network as the bot then /set %trigger ! ** or any trigger you choose then your ready to set it up for a chanel. first add your server to autojoin with ?addserver add server then a channel to autojoin with ?autojoin add network #channel now your ready to set yourself as the channel owner by typing !addowner nick channel again the nick must be on the channel at the time of adding. its best if the bot is the real channel owner, and you get your status from the bot. now type !commands and take a look through the commands and have fun 🙂 ** COMMANDS ?about bot/nick ?act channel message ?addowner nick channel ?addadmin nick ?addop nick ?addhelper nick ?addvoice nick ?autojoin add/del/list network channel ?badnick add/del nick ?ban add/del nick reason ?baninfo total/nick ?bigflood on/off/status # ( eg: ?bigflood on 200 ) ( 200 characters per message sent ) ?botmaster nick ?checknick nick ?clonescanner on/off ?commands ?cycle channel ?dns nick/address ?flood on/off/status #:# ( eg: ?flood on 10:3 )( 10 lines in 3 seconds ) ?flyby on/off/status ?global messsage ?greet on/off message ?ircop scan channel ?kick nick reason ?kill ?lastseen nick ?modelock list/modes ?protect on off ?reboot ?relay on channel_1 channel_2 ?remember info_here ( the first word of your info, will be the trigger to retrieve the info ) ?rules ?say channel message ?set nick/password nick/password ?server add/del server ?spam on/off/status ?stats nick ( or: ?stats reset nick ) ?topiclock on/off topic ?trigger trigger /addowner nick ( Must be on the same channel ) ** NOTE this bot recognises by nick and address, so if your hostmask changes alot this would most likely not be a good bot for you Made on IrCQNet works with anope type services this is still a work in progress so im open to suggestion although im tryin to keep away from such commands as !op !deop etc etc ;?about bot/nick ;?act channel message ;?addowner nick channel ;?addadmin nick ;?addop nick ;?addhelper nick ;?addvoice nick ;?autojoin add/del/list network channel ;?badnick add/del nick ;?ban add/del nick reason ;?baninfo total/nick ;?bigflood on/off/status # ( eg: ?bigflood on 200 ) ( 200 characters per message sent ) ;?botmaster nick ;?checknick nick ;?clonescanner on/off ;?commands ;?cycle channel ;?dns nick/address ;?flood on/off/status #:# ( eg: ?flood on 10:3 )( 10 lines in 3 seconds ) ;?flyby on/off/status ;?forget info_here ;?global messsage ;?greet on/off message ;?ircop scan channel ;?kick nick reason ;?kill ;?lastseen nick ;?modelock list/modes ;?protect on off ;?reboot ;?relay on channel_1 channel_2 ;?remember info_here ( the first word of your info, will be the trigger to retrieve the info ) ;?remuser nick channel ;?rules ;?say channel message ;?set nick/password nick/password ;?server add/del server ;?spam on/off/status ;?stats nick ( or: ?stats reset nick ) ;?topiclock on/off topic ;?trigger trigger ;/addowner nick ( Must be on the same channel ) /* On Load/Unload Events */ on 1:load: { set %botstartdate $fulldate | echo -s 04,01**** Loaded %logo.l SassIRC 12,01m04,01I04,01R08,01C Channel Protection Bot %logo.r Coded By %logo.l PuNkTuReD %logo.r } on 1:unload: { echo -s 04,01**** Unloaded %logo.l SassIRC 12,01m04,01I04,01R08,01C Channel Protection Bot %logo.r Coded By %logo.l PuNkTuReD %logo.r } /* On Start/Exit Events */ on *:start: { if (!$hget(Badwords)) { hmake Badwords 20 } if ($exists(Badwords.hsh)) { hload Badwords Badwords.hsh } if (!$hget(AutoJoin)) { hmake AutoJoin 20 } if ($exists(AutoJoin.hsh)) { hload AutoJoin AutoJoin.hsh } if (!$hget(Servers)) { hmake Servers 20 } if ($exists(Servers.hsh)) { hload Servers Servers.hsh } set -u5 %a 1 set -u5 %b $hget(Servers,0).item while %a <= %b { if (%a == 1) { server $hget(Servers,%a).item | inc %a } else { server -m $hget(Servers,%a).item | inc %a } } else { haltdef } } on *:exit: { if ($hget(Servers)) { hsave -o Servers Servers.hsh } if ($hget(AutoJoin)) { hsave -o AutoJoin AutoJoin.hsh } if ($hget(Badwords)) { hsave -o Badwords Badwords.hsh } } /* On Connect Event */ on *:connect: { nick %botnick | identify %botpass | join $hget(Autojoin,$network) } /* On Join/Part/Quit Events */ on *:join:#: { set $+(%,$nick,totaljoin) $calc($($+(%,$nick,totaljoin),2) + 1) if ($($+(%,$chan,flyby),2) == on) { set -u60 $+(%,join,$chan,$nick) $nick } if (%serverrelay == on) && ($chan == %rchan) { relayevent $network $nick joined # } if (%clonescanner == on) && ($ialchan($strip($address($nick,2)),$chan,0) > 1) { .msg $chan %logo.l $nick %logo.r is a clone. %logo.l $ialchan($strip($address($nick,2)),$chan,0) %logo.r Active connections. From %logo.l $strip($address($nick,2)) %logo.r } if (%relay == on) && ($chan == %chan1) { msg %chan2 Join %logo.l $nick %logo.r } if ($nick == $me) && ($chan == $gettok($readini(users.ini,modelock,$chan),1,32)) { .msg $chan %logo.l ModeLock Enforcer 04,01%logo.r | .msg $chan %logo.l Enforcing Modes %logo.r $gettok($readini(users.ini,modelock,$chan),2-,32) | mode $chan $gettok($readini(users.ini,modelock,$chan),2-,32) } if ($nick == $gettok($readini(badnicks.ini,$chan,$nick),1,32)) { ban -ku300 $chan $nick 2 Bad Nick. } if ($($+(%,greet,$chan),2) == on) { msg $chan $($+(%,joingreet,$chan),2) } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),botmaster,$nick),2,32)) { .msg $chan %logo.l Bot Master %logo.r04,01 $nick has joined. } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { .msg $chan %logo.l $chan 04,01Owner %logo.r $+ $nick has joined. | mode $chan +qov $nick $nick $nick | halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == admin) { .msg $chan %logo.l $chan 04,01Admin %logo.r $+ $nick has joined. | mode $chan +aov $nick $nick $nick | halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == op) { .msg $chan %logo.l $chan 04,01Op %logo.r $+ $nick has joined. | mode $chan +ov $nick $nick | halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == helper) { .msg $chan %logo.l $chan 04,01Helper %logo.r $+ $nick has joined. | mode $chan +hv $nick $nick | halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == voice) { .msg $chan %logo.l $chan 04,01Voice %logo.r $+ $nick has joined. | mode $chan +v $nick | halt } } on *:part:#: { set $+(%,$nick,totalparts) $calc($($+(%,$nick,totalparts),2) + 1) if (%serverrelay == on) && ($chan == %rchan) { relayevent $network $nick parted # } if ($($+(%,join,$chan,$nick),2) == $nick) && ($($+(%,$chan,flyby),2) == on) { $iif($+(%,flyby,$chan),inc $+(%,flyby,$chan),set $+(%,flyby,$chan) 1) | ban -u300 $chan $nick 2 Fly-By Protect | .msg $chan %logo.l $($+(%,join,$chan,$nick),2) %logo.r was Fly-By %logo.l $($+(%,flyby,$chan),2) %logo.r Since $($+(%,botstartdate),2) } if (%relay == on) && ($chan == %chan1) { msg %chan2 Part %logo.l $nick %logo.r } if (!$read(lastseen.txt, w, * $+ $nick- $+ *)) { write lastseen.txt %logo.l $nick %logo.r was last seen leaving %logo.l $chan %logo.r On %logo.l $fulldate %logo.r } else { write -dw $+ * $+ $nick $+ * lastseen.txt | write lastseen.txt %logo.l $nick %logo.r was last seen leaving %logo.l $chan %logo.r On %logo.l $fulldate %logo.r } } on 1:quit: { chkflyby set $+(%,$nick,totalquits) $calc($($+(%,$nick,totalquits),2) + 1) if (*.split isin $strip($1-)) { if (!%ns) { ame 4,1%logo.l NetSplit Detected 4,1%logo.r | set -u180 %ns 1 } } if (%relay == on) { msg %chan2 Quit - %logo.l $nick %logo.r } if (!$read(lastseen.txt, w, * $+ $nick $+ *)) { write lastseen.txt %logo.l $nick %logo.r was last seen leaving %logo.l $network %logo.r On %logo.l $fulldate %logo.r } else { write -dw $+ * $+ $nick $+ * lastseen.txt | write lastseen.txt %logo.l $nick %logo.r was last seen leaving %logo.l $network %logo.r On %logo.l $fulldate %logo.r } if (%serverrelay == on) { var %a = $comchan($nick,0) while (%a) { if ($comchan($nick,%a) == %rchan) { relayevent $network $nick quit: $iif(($1-),$1-,No Quit Message) | dec %a } else { dec %a } } } } /* On Nick Event */ on *:nick: { if (%relay == on) && ($chan == %chan1) { msg %chan2 %logo.l $nick %logo.r is now %logo.l $newnick %logo.r } if ($nick == $gettok($readini(users.ini,botmaster,$nick),1,32)) { writeini users.ini botmaster $newnick $newnick $gettok($readini(users.ini,botmaster,$nick),2,32) | remini users.ini botmaster $nick } var %a = 1 var %b = $comchan($newnick,0) while %a <= %b { if ($read(abuse.txt, w, $newnick $+ *)) { .msg $comchan($newnick,%a) $gettok($read(abuse.txt, w, $newnick $+ *),2-,32) } if ($newnick == $gettok($readini(badnicks.ini,$comchan($newnick,%a),$newnick),1,32)) { ban -ku300 $comchan($newnick,%a) $newnick 2 Bad Nick } if ($gettok($readini($+($network,users.ini),$comchan($newnick,%a),$nick),2,32) == owner) { writeini $+($network,users.ini) $comchan($newnick,%a) $newnick $gettok($readini(users.ini,$comchan($newnick,%a),$nick),1,32) owner | remini $+($network,users.ini) $comchan($newnick,%a) $nick } if ($gettok($readini($+($network,users.ini),$comchan($newnick,%a),$nick),2,32) == admin) { writeini $+($network,users.ini) $comchan($newnick,%a) $newnick $gettok($readini(users.ini,$comchan($newnick,%a),$nick),1,32) admin | remini $+($network,users.ini) $comchan($newnick,%a) $nick } if ($gettok($readini($+($network,users.ini),$comchan($newnick,%a),$nick),2,32) == op) { writeini $+($network,users.ini) $comchan($newnick,%a) $newnick $gettok($readini(users.ini,$comchan($newnick,%a),$nick),1,32) op | remini $+($network,users.ini) $comchan($newnick,%a) $nick } if ($gettok($readini($+($network,users.ini),$comchan($newnick,%a),$nick),2,32) == helper) { writeini $+($network,users.ini) $comchan($newnick,%a) $newnick $gettok($readini(users.ini,$comchan($newnick,%a),$nick),1,32) helper | remini $+($network,users.ini) $comchan($newnick,%a) $nick } if ($gettok($readini($+($network,users.ini),$comchan($newnick,%a),$nick),2,32) == voice) { writeini $+($network,users.ini) $comchan($newnick,%a) $newnick $gettok($readini(users.ini,$comchan($newnick,%a),$nick),1,32) voice | remini $+($network,users.ini) $comchan($newnick,%a) $nick } else { inc %a } } } /* On dns Event */ on 1:dns: { var %n = $dns(0) .msg %targ %logo.l DNS %logo.r Found %logo.l %n %logo.r Addresse(s) for %logo.l $dns(%n).addr %logo.r while (%n > 0) { .msg %targ %logo.l DNS %logo.r Address: %logo.l $dns(%n).addr %logo.r Ip: %logo.l $dns(%n).ip %logo.r | dec %n } } /* On Topic Event */ on 1:topic:#: { if ($nick == ChanServ) || ($nick == Pazuzu) { halt } if ($nick == $me) || ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { set $+(%,topic,$3) $1- | halt } if ($($+(%,topiclock,$chan),2) == on) { .msg $chan %logo.l Enforcing Topic %logo.r $($+(%,topic,$chan),2) | topic $chan $($+(%,topic,$chan),2) } } /* On Mode Event */ on *:mode:#: { if ($($+(%,protect,$chan),2) == on) { if ($chan == $gettok($readini(users.ini,modelock,$chan),1,32)) { if ($nick == ChanServ) || ($nick == Pazuzu) { halt } if ($nick == $me) || ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { halt } else { mode $chan $replace($1-,+,-) | .msg $chan %logo.l Enforcing Modes %logo.r $gettok($readini(users.ini,modelock,$chan),2-,32) | mode $chan $gettok($readini(users.ini,modelock,$chan),2-,32) } } } } /* On Ban/Unban Events */ on *:ban:#: { set $+(%,$nick,totalbans) $calc($($+(%,$nick,totalbans),2) + 1) | write banned.txt %logo.l $chan %logo.r Ban %logo.l $banmask %logo.r was banned by %logo.l $nick %logo.r on %logo.l $fulldate %logo.r } on *:unban:#: { write -dw $+ * $+ $2 $+ * banned.txt } /* On Kick Event */ on *:kick:#: { set $+(%,$nick,totalkicks) $calc($($+(%,$nick,totalkicks),2) + 1) if ($chan == %rchan) { relayevent $network $nick kicked $knick from # } if ($($+(%,protect,$chan),2) == on) { if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == admin) { halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { halt } if ($address($knick,2) == $gettok($readini($+($network,users.ini),$chan,$knick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$knick),2,32) == op) { remini $+($network,users.ini) $chan $nick | invite $nick $chan | io | .msg $chan %logo.l $nick %logo.r You may not kick a channel op. | .msg $chan %logo.l $nick %logo.r you are now being stripped of your %logo.l Op %logo.r status. | mode -o $nick } if ($address($knick,2) == $gettok($readini($+($network,users.ini),$chan,$knick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$knick),2,32) == admin) { remini $+($network,users.ini) $chan $nick | invite $nick $chan | io | .msg $chan %logo.l $nick %logo.r You may not kick a channel admin. | .msg $chan %logo.l $nick %logo.r you are now being stripped of your %logo.l Op %logo.r status. | mode -o $nick } if ($address($knick,2) == $gettok($readini($+($network,users.ini),$chan,$knick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$knick),2,32) == owner) { remini $+($network,users.ini) $chan $nick | invite $nick $chan | io | .msg $chan %logo.l $nick %logo.r You may not kick a channel owner. | .msg $chan %logo.l $nick %logo.r you are now being stripped of your %logo.l Op %logo.r status. | mode -o $nick } } } /* On Op/Deop Events */ on *:op:#: { if ($($+(%,protect,$chan),2) == on) { if (%relay == on) && ($chan == %chan1) { .msg %chan2 Op %logo.l $opnick %logo.r by %logo.l $nick %logo.r } if ($nick == $me) || ($nick == chanserv) || ($nick == Pazuzu) { halt } if ($address($opnick,2) == $gettok($readini($+($network,users.ini),$chan,$opnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$opnick),2,32) == op) { halt } if ($address($opnick,2) == $gettok($readini($+($network,users.ini),$chan,$opnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$opnick),2,32) == admin) { halt } if ($address($opnick,2) == $gettok($readini($+($network,users.ini),$chan,$opnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$opnick),2,32) == owner) { halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == admin) { halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { halt } else { io | .msg $chan %logo.l $opnick %logo.r is not a %logo.l Op %logo.r in this channel. | mode $chan -o $opnick | .msg $chan %logo.l $nick %logo.r you are now being stripped of your %logo.l Op %logo.r status. | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick } } } on *:deop:#: { if ($+(%,protect,$chan)) { if (%relay == on) && ($chan == %chan1) { .msg %chan2 DeOp %logo.l $opnick %logo.r by %logo.l $nick %logo.r } if ($nick == $me) { halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == admin) { halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { halt } if ($address($opnick,2) == $gettok($readini($+($network,users.ini),$chan,$opnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$opnick),2,32) == owner) { remini $+($network,users.ini) $chan $nick | io | .msg $chan You may not deop a channel owner, You are now being stripped of your Op status. | mode $chan +o $opnick | mode $chan -o $nick } if ($address($opnick,2) == $gettok($readini($+($network,users.ini),$chan,$opnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$opnick),2,32) == admin) { remini $+($network,users.ini) $chan $nick | io | .msg $chan You may not deop a channel admin, You are now being stripped of your Op status. | mode $chan +o $opnick | mode $chan -o $nick } if ($address($opnick,2) == $gettok($readini($+($network,users.ini),$chan,$opnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$opnick),2,32) == op) { remini $+($network,users.ini) $chan $nick | io | .msg $chan You may not deop a channel op, You are now being stripped of your Op status. | mode $chan +o $opnick | mode $chan -o $nick } } } /* On Help/Dehelp Events */ on *:help:#: { if ($+(%,protect,$chan)) { if (%relay == on) && ($chan == %chan1) { .msg %chan2 Help %logo.l $hnick %logo.r by %logo.l $nick %logo.r } if ($nick == $me) || ($nick == chanserv) || ($nick == Pazuzu) { halt } if ($gettok($readini($+($network,users.ini),$chan,$hnick),2,32) == helper) || ($gettok($readini($+($network,users.ini),$chan,$hnick),2,32) == op) { halt } if ($gettok($readini($+($network,users.ini),$chan,$hnick),2,32) == admin) || ($gettok($readini($+($network,users.ini),$chan,$hnick),2,32) == owner) { halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == op) { halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == admin) { halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { halt } if ($gettok($readini($+($network,users.ini),$chan,$hnick),2,32) != helper) { io | .msg $chan %logo.l $hnick %logo.r is not a %logo.l Helper %logo.r in this channel. | mode $chan -h $hnick | .msg $chan %logo.l $nick %logo.r you are now being stripped of your %logo.l Op %logo.r status. | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick } } } on *:dehelp:#: { if ($+(%,protect,$chan)) { if (%relay == on) && ($chan == %chan1) { msg %chan2 DeHelp %logo.l $hnick %logo.r by %logo.l $nick %logo.r } if ($nick == $me) { halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == op) { halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == admin) { halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { halt } if ($address($hnick,2) == $gettok($readini($+($network,users.ini),$chan,$hnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$hnick),2,32) == owner) { io | .msg $chan You may not dehelp a channel owner, You are now being stripped of your Op status. | mode $chan +h $hnick | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick } if ($address($hnick,2) == $gettok($readini($+($network,users.ini),$chan,$hnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$hnick),2,32) == admin) { io | .msg $chan You may not dehelp a channel admin, You are now being stripped of your Op status. | mode $chan +h $hnick | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick } if ($address($hnick,2) == $gettok($readini($+($network,users.ini),$chan,$hnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$hnick),2,32) == op) { io | .msg $chan You may not dehelp a channel op, You are now being stripped of your Op status. | mode $chan +h $hnick | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick } if ($address($hnick,2) == $gettok($readini($+($network,users.ini),$chan,$hnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$hnick),2,32) == helper) { io | .msg $chan You may not dehelp a channel helper, You are now being stripped of your Op status. | mode $chan +h $hnick | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick } } } /* On Voice/Devoice Events */ on *:voice:#: { if ($+(%,protect,$chan)) { if (%relay == on) && ($chan == %chan1) { msg %chan2 Voice %logo.l $vnick %logo.r by %logo.l $nick %logo.r } if ($nick == $me) || ($nick == chanserv) || ($nick == Pazuzu) { halt } if ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) == voice) || ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) == helper) || ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) == op) { halt } if ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) == admin) || ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) == owner) { halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == helper) { halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == op) { halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == admin) { halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { halt } if ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) != voice) { io | .msg $chan %logo.l $vnick %logo.r is not a %logo.l Voice %logo.r in this channel. | mode $chan -v $vnick | .msg $chan %logo.l $nick %logo.r you are now being stripped of your %logo.l Op %logo.r status. | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick } } } on *:devoice:#: { if ($+(%,protect,$chan)) { if (%relay == on) && ($chan == %chan1) { msg %chan2 DeVoice %logo.l $vnick %logo.r by %logo.l $nick %logo.r } if ($nick == $me) { halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == helper) { halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == op) { halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == admin) { halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { halt } if ($address($vnick,2) == $gettok($readini($+($network,users.ini),$chan,$vnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) == owner) { io | .msg $chan You may not devoice a channel owner, You are now being stripped of your Op status. | mode $chan +v $vnick | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick } if ($address($vnick,2) == $gettok($readini($+($network,users.ini),$chan,$vnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) == admin) { io | .msg $chan You may not devoice a channel admin, You are now being stripped of your Op status. | mode $chan +v $vnick | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick } if ($address($vnick,2) == $gettok($readini($+($network,users.ini),$chan,$vnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) == op) { io | .msg $chan You may not devoice a channel op, You are now being stripped of your Op status. | mode $chan +v $vnick | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick } if ($address($vnick,2) == $gettok($readini($+($network,users.ini),$chan,$vnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) == helper) { io | .msg $chan You may not devoice a channel helper, You are now being stripped of your Op status. | mode $chan +v $vnick | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick } if ($address($vnick,2) == $gettok($readini($+($network,users.ini),$chan,$vnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) == voice) { io | .msg $chan You may not devoice a channel voice, You are now being stripped of your Op status. | mode $chan +v $vnick | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick } } } /* On Notice Event */ on *:notice:*:*: { if ($me * is already in use* isin $strip($1-)) { .msg nickserv ghost %botnick %botpass } if (Ghost with your nick has been killed* isin $strip($1-)) { .nick %botnick | .identify %botpass } if (STATUS isin $strip($1-)) { if (0 isin $strip($1-)) { .msg %targ %logo.l %targnick %logo.r No such user online, or not registered. } if (1 isin $strip($1-)) { .msg %targ %logo.l %targnick %logo.r User not recognised as nick owner. } if (2 isin $strip($1-)) { .msg %targ %logo.l %targnick %logo.r User recognised as nick owner via Access List only. } if (3 isin $strip($1-)) { .msg %targ %logo.l %targnick %logo.r User recognised as nick owner via Identify command. } } } /* On Notify/UnNotify Events */ on 1:notify: { set $+(%,ticks,$network,$nick) 0 $+(.timer,ticks,$network,$nick) 0 1 inc $($+(%,ticks,$network,$nick),1) 1 } on 1:unotify: { echo -a $nick was online for: $duration($($+(%,ticks,$network,$nick),2)) $+(.timer,ticks,$network,$nick) off set $+(%,tickstotal,$network,$nick) $calc($($+(%,tickstotal,$network,$nick),2) + $($+(%,ticks,$network,$nick),2)) } /* Rawmode */ on *:rawmode:%rchan: { if (%serverrelay == on) { relayevent $network $nick sets mode $1 on $2 } } /* On Action Event */ on *:action:*:*: { set $+(%,$nick,totalmsg) $calc($($+(%,$nick,totalmsg),2) + 1) set $+(%,$nick,totalchar) $calc($len($1-) + $($+(%,$nick,totalchar),2)) set $+(%,$nick,totalword) $calc($numtok($1-,32) + $($+(%,$nick,totalword),2)) if (%serverrelay == on) && ($chan == %rchan) { relayevent $network $+($chr(60),$nick) $1- } if (%relay == on) && ($chan == %chan1) { msg %chan2 %logo.l $nick %logo.r $1- } } /* On Text Event */ on *:text:*:*: { set $+(%,$nick,totalmsg) $calc($($+(%,$nick,totalmsg),2) + 1) set $+(%,$nick,totalchar) $calc($len($1-) + $($+(%,$nick,totalchar),2)) set $+(%,$nick,totalword) $calc($numtok($1-,32) + $($+(%,$nick,totalword),2)) if (%serverrelay == on) && ($chan == %rchan) { relayevent $network $+($chr(60),$nick,$chr(62)) $1- } ; ; Flood Catcher ( #:# Lines:Seconds ) ; if ($($+(%,$chan,flood),2) == on) { set -u $+ $+(%,$chan,floodin),2) $+(%,$nick,flood) 1 if ($($+(%,$nick,flood),2) >= $($+(%,$chan,floodlines),2)) { unset $+(%,$nick,flood) | ban -ku300 $chan $nick 2 Flooding. | .notice $nick You have been banned from %logo.l $chan %logo.r for Flooding. } } ; ; Flood Catcher ( Long Messages ) ; if ($($+(%,$chan,bflood),2) == on) { if ($len($strip($1-)) >= $($+(%,$chan,bigflood),2)) { ban -ku300 $chan $nick 2 Flooding. | .notice $nick You have been banned from %logo.l $chan %logo.r for Flooding. } } ; ; single server relay ; if (%relay == on) && ($chan == %chan1) { msg %chan2 %logo.l $nick %logo.r $1- } if (!$read(info.txt, w,$1 $+ *)) { haltdef } if ($read(info.txt, w,$1 $+ *)) { if ($1) && (!$2) { .msg $chan $read(info.txt, w,$1 $+ *) } } if ($($+(%,trigger,$nick),2) == 3) { if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),botmaster,$nick),2,32)) { unset $+(%,trigger,$nick) } else { .msg $chan %logo.l $nick %logo.r You are being ignored for 5 minutes, for trigger abuse. | ignore -u300 $nick | halt } } ; ; Public Commands ; if ($+(%trigger,about) == $strip($1)) { .timer 1 1 .notice $nick %logo.l SassIRC 12,01m04,01I04,01R08,01C Channel Protection Bot %logo.r Coded By %logo.l PuNkTuReD %logo.r .timer 1 4 .notice $nick Is currently being used on %logo.l $hget(Servers,0).item %logo.r server(s) in a total of %logo.l $+(%,totchans),2) %logo.r Channel(s), Last Reboot: %logo.l $uptime(server,2) %logo.r ago. .timer 1 7 .notice $nick %logo.l $+(%trigger,commands) %logo.r to see a list of available commands. } if ($+(%trigger,checknick) == $strip($1)) { if (!$2) { eis | .msg $chan ?checknick command: ?checknick nick } else { set -u10 %targ $chan | set -u10 %targnick $2 | .msg nickserv status $2 } } if ($+(%trigger,commands) == $strip($1)) { .notice $nick 04,01**** %logo.l Bot Master %logo.r commands are 04,01Red. %logo.l Channel Owner %logo.r commands are 07,01Orange. %logo.l Public %logo.r commands are 08,01Yellow. ; Bot Master Commands if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),botmaster,$nick),2,32)) { .notice $nick 04,01?act nick/channel message - 04,01?addowner nick channel - 04,01?autojoin add/del/list network channel - 04,01?botmaster nick - 04,01?clonescanner on/off - 04,01?cycle channel - .notice $nick 04,01?global messsage - 04,01?kill - 04,01?reboot - 04,01?relay on/off channel_1 channel_2 - 04,01?remember info_here - 04,01?say nick/channel message - 04,01?set nick/password nick/password - 04,01?server add/del server - } ; Channel Owner Commands if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner ) { .notice $nick 07,01?addadmin nick - 07,01?addop nick - 07,01?addhelper nick - 07,01?addvoice nick - 07,01?badnick add/del nick - 07,01?ban add/del nick reason - 07,01?baninfo total/banmask - .notice $nick 07,01?bigflood on/off/status # - 07,01?flood on/off/status #:# - 07,01?flyby on/off/status - 07,01?greet on/off message - 07,01?kick nick reason - 07,01?modelock list/modes - 07,01?protect on/off - 07,01?spam on/off/status - 07,01?topiclock on/off topic - } ; Public Commands .notice $nick 08,01?about - 08,01?checknick nick - 08,01?commands - 08,01?dns nick/address - 08,01?ircop scan channel - 08,01?lastseen nick - 08,01?stats nick - 08,01?rules - } if ($+(%trigger,dns) == $strip($1)) { if (!$2) { eis | .msg $chan ?dns command: ?dns address } if ($2) { set -u5 %targ $chan | .dns $2 } } if ($+(%trigger,ircop) == $strip($1)) { if (!$3) { eis | .msg $chan ?ircop command: ?ircop scan #channel } if ($2 == scan) { if ($me ison $3) { set -u10 %msgchan $chan | set -u10 %chkchan1 $3 | ircopscan %chkchan1 } else { .msg $chan %logo.l $nick %logo.r I can only scan channels i am on. } } } if ($+(%trigger,lastseen) == $strip($1)) { if (!$2) { eis | .msg $chan ?lastseen command: ?lastseen nick | halt } if ($2) { if ($2 ison $chan) { .msg $chan %logo.l Last Seen04,01 $2 %logo.r is on %logo.l $chan %logo.r already %logo.l $nick %logo.r } else { if ($2 == $gettok($read(lastseen.txt, w,* $+ $2- $+ *),2,32)) { .msg $chan %logo.l Last Seen04,01 $2 %logo.r $read(lastseen.txt, w,* $+ $2- $+ *) } else { .msg $chan %logo.l Last Seen %logo.r I have No Records for $2 } } } } if ($+(%trigger,rules) == $strip($1)) { .timer 1 1 .msg $chan $iif($($+(%,protect,$chan),2) == on,$(%logo.l Channel is being protected %logo.r ),) $iif($($+(%,protect,$chan),2) == on,Status protection (@ % +,Op Hop Voice) ,) .timer 1 4 .msg $chan $iif($chan == $gettok($readini(users.ini,modelock,$chan),1,32),$(%logo.l Mode Lock %logo.r ),) $iif($chan == $gettok($readini(users.ini,modelock,$chan),1,32), $gettok($readini(users.ini,modelock,$chan),2-,32) ,) .timer 1 7 .msg $chan $iif($($+(%,topiclock,$chan),2) == on,$(%logo.l Topic lock %logo.r ),) $iif($($+(%,topiclock,$chan),2) == on,$($+(%,topic,$chan),2) ,) .timer 1 10 .msg $chan $iif($($+(%,greet,$chan),2) == on,$(%logo.l Greet Message %logo.r ),) $iif($($+(%,greet,$chan),2) == on,$($+(%,joingreet,$chan),2) ,) .timer 1 13 .msg $chan $iif($($+(%,sp,$chan),2) == on,$(%logo.l Spam Protect %logo.r ),) $iif($($+(%,$chan,flyby),2) == on,$(%logo.l Fly-By Protect %logo.r ),) $iif($($+(%,$chan,flood),2) == on,$(%logo.l Flood Protect %logo.r ),) $iif($($+(%,$chan,bflood),2) == on,$(%logo.l Big Flood Protect %logo.r ),) } if ($+(%trigger,stats) == $strip($1)) { if (!$2) { eis | .msg $chan ?stats command: ?stats nick | .msg $chan Or: ?stats reset nick | halt } if ($2) { if ($2 == reset) && ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),botmaster,$nick),2,32)) { unset $+(%,$3,*) | .msg $chan %logo.l Stats for04,01 $3 %logo.r Have Been Reset. | halt } else { if ($($+(%,$2,totaljoin),2)) { if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),botmaster,$nick),2,32)) { .msg $chan %logo.l Stats for04,01 $2 %logo.r Total Joins: %logo.l $iif($($+(%,$2,totaljoin),2),$($+(%,$2,totaljoin),2),0) %logo.r Total Parts: %logo.l $iif($($+(%,$2,totalparts),2),$($+(%,$2,totalparts),2),0) %logo.r Total Quits: %logo.l $iif($($+(%,$2,totalquits),2),$($+(%,$2,totalquits),2),0) %logo.r Total Bans: %logo.l $iif($($+(%,$2,totalbans),2),$($+(%,$2,totalbans),2),0) %logo.r Total Kicks: %logo.l $iif($($+(%,$2,totalkicks),2),$($+(%,$2,totalkicks),2),0) %logo.r Total Messages Sent: %logo.l $iif($($+(%,$2,totalmsg),2),$($+(%,$2,totalmsg),2),0) %logo.r Total Letters: %logo.l $iif($($+(%,$2,totalchar),2),$($+(%,$2,totalchar),2),0) %logo.r Total Words: %logo.l $iif($($+(%,$2,totalword),2),$($+(%,$2,totalword),2),0) %logo.r Total Online Time %logo.l $duration($calc($($+(%,ticks,$network,$2),2) + $($+(%,tickstotal,$network,$2),2))) %logo.r halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { .msg $chan %logo.l Stats for04,01 $2 %logo.r Total Joins: %logo.l $iif($($+(%,$2,totaljoin),2),$($+(%,$2,totaljoin),2),0) %logo.r Total Parts: %logo.l $iif($($+(%,$2,totalparts),2),$($+(%,$2,totalparts),2),0) %logo.r Total Quits: %logo.l $iif($($+(%,$2,totalquits),2),$($+(%,$2,totalquits),2),0) %logo.r Total Bans: %logo.l $iif($($+(%,$2,totalbans),2),$($+(%,$2,totalbans),2),0) %logo.r Total Kicks: %logo.l $iif($($+(%,$2,totalkicks),2),$($+(%,$2,totalkicks),2),0) %logo.r Total Messages Sent: %logo.l $iif($($+(%,$2,totalmsg),2),$($+(%,$2,totalmsg),2),0) %logo.r Total Letters: %logo.l $iif($($+(%,$2,totalchar),2),$($+(%,$2,totalchar),2),0) %logo.r Total Words: %logo.l $iif($($+(%,$2,totalword),2),$($+(%,$2,totalword),2),0) %logo.r Total Online Time %logo.l $duration($calc($($+(%,ticks,$network,$2),2) + $($+(%,tickstotal,$network,$2),2))) %logo.r halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == admin) { .msg $chan %logo.l Stats for04,01 $2 %logo.r Total Joins: %logo.l $iif($($+(%,$2,totaljoin),2),$($+(%,$2,totaljoin),2),0) %logo.r Total Parts: %logo.l $iif($($+(%,$2,totalparts),2),$($+(%,$2,totalparts),2),0) %logo.r Total Quits: %logo.l $iif($($+(%,$2,totalquits),2),$($+(%,$2,totalquits),2),0) %logo.r Total Bans: %logo.l $iif($($+(%,$2,totalbans),2),$($+(%,$2,totalbans),2),0) %logo.r Total Kicks: %logo.l $iif($($+(%,$2,totalkicks),2),$($+(%,$2,totalkicks),2),0) %logo.r Total Messages Sent: %logo.l $iif($($+(%,$2,totalmsg),2),$($+(%,$2,totalmsg),2),0) %logo.r Total Letters: %logo.l $iif($($+(%,$2,totalchar),2),$($+(%,$2,totalchar),2),0) %logo.r Total Words: %logo.l $iif($($+(%,$2,totalword),2),$($+(%,$2,totalword),2),0) %logo.r Total Online Time %logo.l $duration($calc($($+(%,ticks,$network,$2),2) + $($+(%,tickstotal,$network,$2),2))) %logo.r halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == op) { .msg $chan %logo.l Stats for04,01 $2 %logo.r Total Joins: %logo.l $iif($($+(%,$2,totaljoin),2),$($+(%,$2,totaljoin),2),0) %logo.r Total Parts: %logo.l $iif($($+(%,$2,totalparts),2),$($+(%,$2,totalparts),2),0) %logo.r Total Quits: %logo.l $iif($($+(%,$2,totalquits),2),$($+(%,$2,totalquits),2),0) %logo.r Total Bans: %logo.l $iif($($+(%,$2,totalbans),2),$($+(%,$2,totalbans),2),0) %logo.r Total Kicks: %logo.l $iif($($+(%,$2,totalkicks),2),$($+(%,$2,totalkicks),2),0) %logo.r Total Messages Sent: %logo.l $iif($($+(%,$2,totalmsg),2),$($+(%,$2,totalmsg),2),0) %logo.r Total Letters: %logo.l $iif($($+(%,$2,totalchar),2),$($+(%,$2,totalchar),2),0) %logo.r Total Words: %logo.l $iif($($+(%,$2,totalword),2),$($+(%,$2,totalword),2),0) %logo.r Total Online Time %logo.l $duration($calc($($+(%,ticks,$network,$2),2) + $($+(%,tickstotal,$network,$2),2))) %logo.r halt } if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == helper) { .msg $chan %logo.l Stats for04,01 $2 %logo.r Total Joins: %logo.l $iif($($+(%,$2,totaljoin),2),$($+(%,$2,totaljoin),2),0) %logo.r Total Parts: %logo.l $iif($($+(%,$2,totalparts),2),$($+(%,$2,totalparts),2),0) %logo.r Total Quits: %logo.l $iif($($+(%,$2,totalquits),2),$($+(%,$2,totalquits),2),0) %logo.r Total Bans: %logo.l $iif($($+(%,$2,totalbans),2),$($+(%,$2,totalbans),2),0) %logo.r Total Kicks: %logo.l $iif($($+(%,$2,totalkicks),2),$($+(%,$2,totalkicks),2),0) %logo.r Total Messages Sent: %logo.l $iif($($+(%,$2,totalmsg),2),$($+(%,$2,totalmsg),2),0) %logo.r Total Letters: %logo.l $iif($($+(%,$2,totalchar),2),$($+(%,$2,totalchar),2),0) %logo.r Total Words: %logo.l $iif($($+(%,$2,totalword),2),$($+(%,$2,totalword),2),0) %logo.r Total Online Time %logo.l $duration($calc($($+(%,ticks,$network,$2),2) + $($+(%,tickstotal,$network,$2),2))) %logo.r halt } else { .msg $chan %logo.l Stats for04,01 $2 %logo.r Total Joins: %logo.l $iif($($+(%,$2,totaljoin),2),$($+(%,$2,totaljoin),2),0) %logo.r Total Parts: %logo.l $iif($($+(%,$2,totalparts),2),$($+(%,$2,totalparts),2),0) %logo.r Total Quits: %logo.l $iif($($+(%,$2,totalquits),2),$($+(%,$2,totalquits),2),0) %logo.r Total Bans: %logo.l $iif($($+(%,$2,totalbans),2),$($+(%,$2,totalbans),2),0) %logo.r Total Kicks: %logo.l $iif($($+(%,$2,totalkicks),2),$($+(%,$2,totalkicks),2),0) %logo.r Total Messages Sent: %logo.l $iif($($+(%,$2,totalmsg),2),$($+(%,$2,totalmsg),2),0) %logo.r Total Letters: %logo.l $iif($($+(%,$2,totalchar),2),$($+(%,$2,totalchar),2),0) %logo.r Total Words: %logo.l $iif($($+(%,$2,totalword),2),$($+(%,$2,totalword),2),0) %logo.r } } else { .msg $chan %logo.l Stats for04,01 $2 %logo.r No stats Recorded. } } } } ; ; Bot Master Commands ; if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),botmaster,$nick),2,32)) { if ($+(%trigger,act) == $strip($1)) { if (!$3) { eis | .msg $chan ?act command: ?act nick/#channel message } if ($3) { .describe $chan %logo.l $me %logo.r $3- | .describe $2 $3- } } if ($+(%trigger,addowner) == $strip($1)) { if (!$3) { eis | .msg $chan ?addowner command: ?addowner nick #channel } if ($3) { notify $2 | writeini $+($network,users.ini) $3 $2 $address($2,2) owner | .msg $chan Added %logo.l $2 %logo.r as %logo.l $3 %logo.r Owner. } } if ($+(%trigger,autojoin) == $strip($1)) { if (!$2) { eis | .msg $chan ?autojoin command: ?autojoin add/del/list network #channel } if ($2 == add) { $iif(%totchans == $null,set %totchans 1,set %totchans $calc(%totchans + 1)) | hadd -m AutoJoin $3 $iif($hget(Autojoin,$3),$+($hget(Autojoin,$3),$chr(44),$4-),$+($4-,$chr(44))) | .msg $chan Added %logo.l $4 %logo.r to %logo.l $3 %logo.r Autojoin channel(s), I will join on my next reboot. } if ($2 == del) { set %totchans $calc(%totchans - 1) hadd AutoJoin $3 $remtok($hget(Autojoin,$3),$4-,1,44) .msg $chan Deleted %logo.l $4 %logo.r from %logo.l $3 %logo.r Autojoin channel(s), I will leave on my next reboot. } if ($2 == list) { if (!$3) { eis | .msg $chan ?autojoin command: ?autojoin list network } else { .msg $chan I auto join these channel(s) on $+($3,:) %logo.l $hget(Autojoin,$3) %logo.r } } } if ($+(%trigger,badnick) == $strip($1)) { if (!$4) { eis | .msg $chan ?badnick command: ?badnick add/del nick | halt } if ($2 == add) { writeini badnicks.ini $chan $3 $3 | .msg $chan %logo.l Bad Nick04,01 $3 %logo.r Added to bad nicks list for %logo.l $chan %logo.r | halt } if ($2 == del) { remini badnicks.ini $chan $3 | .msg $chan %logo.l Bad Nick04,01 $3 %logo.r Removed from bad nicks list for %logo.l $chan %logo.r | halt } } if ($+(%trigger,baninfo) == $strip($1)) { if (!$2) { eis | .msg $chan ?baninfo command: ?baninfo total/banmask | halt } if ($2 == total) { .msg $chan %logo.l Total Bans %logo.r $lines(banned.txt) | halt } if (!$read(banned.txt, w, * $+ $2- $+ *)) { .msg $chan No Such Ban Exists. | halt } else { .msg $chan $read(banned.txt, w, * $+ $2- $+ *) | halt } } if ($+(%trigger,botmaster) == $strip($1)) { if (!$2) { eis | .msg $chan ?botmaster command: ?botmaster nick | halt } if ($2) { notify $2 | writeini $+($network,users.ini) botmaster $2 $2 $address($2,2) | .msg $chan %logo.l $gettok($readini(users.ini,botmaster,$2),1,32) %logo.r added to %logo.l Master List %logo.r } } if ($+(%trigger,clonescanner) == $strip($1)) { if (!$2) { eis | .msg $chan ?clonescanner command: ?clonescanner on/off } if ($2 == on) { set %clonescanner on | .msg $chan %logo.l Clone Scanner %logo.r On } if ($2 == off) { set %clonescanner off | .msg $chan %logo.l Clone Scanner %logo.r Off } } if ($+(%trigger,cycle) == $strip($1)) { if (!$2) { eis | .msg $chan ?cycle command: ?cycle #channel } if ($2) { .msg $2 %logo.l Cycling %logo.r as ordered by %logo.l $nick 04,01%logo.r | part $2 | .timer 1 1 join $2 } } if ($+(%trigger,forget) == $strip($1)) { write $+(-ds,",$2-,") info.txt | msg $chan ok ill forget that. } if ($+(%trigger,global) == $strip($1)) { if (!$2) { eis | .msg $chan ?global command: ?global message } if ($2) { Global $nick $2- } } if ($+(%trigger,kill) == $strip($1)) { scon -a //ame %logo.l Killed %logo.r by %logo.l $nick %logo.r | exit -n } if ($+(%trigger,openini) == $strip($1)) { run $mircdirusers.ini } if ($+(%trigger,openmircdir) == $strip($1)) { run $mircdir } if ($+(%trigger,raw) == $strip($1)) { if (!$2) { eis | .msg $chan ?raw command: ?raw command } if ($2) { $2- } } if ($+(%trigger,reboot) == $strip($1)) { scon -a //ame %logo.l Rebooting %logo.r as ordered by %logo.l $nick %logo.r command recieved on %logo.l $network %logo.r | exit -nr } if ($+(%trigger,relay) == $strip($1)) { if (!$2) { eis | .msg $chan ?relay command: ?relay channel_1 channel_2 } if (on == $2) { join $3 | set %chan1 $3 | set %chan2 $4 | set %relay on | msg $chan %logo.l Relay %logo.r from %logo.l $3 %logo.r to %logo.l $4 %logo.r } if (off == $2) { part %chan1 | unset %chan1 %chan2 %relay | msg $chan %logo.l Relay %logo.r OFF } } if ($+(%trigger,remember) == $strip($1)) { if (!$2) { eis | .msg $chan ?remember command: ?remember info_here } if (!$read(info.txt, w, $2 *)) && ($2) { write info.txt $2- | .msg $chan Ok, $nick $+ . | halt } if ($read(info.txt, w, $2 *)) && ($2) { write -dw $+ $2 $+ * info.txt | write info.txt $2- | .msg $chan Ok, $nick $+ . Replaced previous info. | halt } } if ($+(%trigger,say) == $strip($1)) { if (!$3) { eis | .msg $chan ?say command: ?say nick/#channel message } if ($3) { .msg $chan %logo.l $me %logo.r $3- | .msg $2 $3- } } if ($+(%trigger,server) == $strip($1)) { if (!$2) { eis | .msg $chan ?server command: ?server add/del server } if ($2 == add) { hadd -m Servers $3- $3- | .msg $chan Added %logo.l $3 %logo.r as %logo.l Autojoin Server %logo.r } if ($2 == del) { hdel -m Servers $3- $3- | .msg $chan Deleted %logo.l $3 %logo.r as %logo.l Autojoin Server %logo.r } } if ($+(%trigger,set) == $strip($1)) { if (!$3) { eis | .msg $chan ?set command: ?set nick/password nick/password } if ($2 == nick) { set %botnick $3 | nick $3 | identify %botpass | .notice $nick Set %logo.l $3 %logo.r as %logo.l BotNick %logo.r } if ($2 == password) { set %botpass $3 | identify $3 | .notice $nick Set %logo.l $3 %logo.r as %logo.l Password %logo.r } } if ($+(%trigger,trigger) == $strip($1)) { if ($2) { set %trigger $2 | msg $chan Trigger is now %logo.l $2- %logo.r } } } ; ; Channel Owner Commands ; if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner ) { if ($+(%trigger,addadmin) == $strip($1)) { if (!$2) { eis | .msg $chan ?addadmin command: ?addadmin nick } if ($2) { notify $2 | writeini $+($network,users.ini) $chan $2 $address($2,2) admin | mode $chan +a $2 | .msg $chan Added %logo.l $2 %logo.r as %logo.l $chan %logo.r Admin. } } if ($+(%trigger,addhelper) == $strip($1)) { if (!$2) { eis | .msg $chan ?addhelper command: ?addhelper nick } if ($2) { notify $2 | writeini $+($network,users.ini) $chan $2 $address($2,2) helper | mode $chan +h $2 | .msg $chan Added %logo.l $2 %logo.r as %logo.l $chan %logo.r Helper. } } if ($+(%trigger,addop) == $strip($1)) { if (!$2) { eis | .msg $chan ?addop command: ?addop nick } if ($2) { notify $2 | writeini $+($network,users.ini) $chan $2 $address($2,2) op | mode $chan +o $2 | .msg $chan Added %logo.l $2 %logo.r as %logo.l $chan %logo.r Op. } } if ($+(%trigger,addvoice) == $strip($1)) { if (!$2) { eis | .msg $chan ?addvoice command: ?addvoice nick } if ($2) { notify $2 | writeini $+($network,users.ini) $chan $2 $address($2,2) voice | mode $chan +v $2 | .msg $chan Added %logo.l $2 %logo.r as %logo.l $chan %logo.r Voice. } } if ($+(%trigger,badnick) == $strip($1)) { if (!$4) { eis | .msg $chan ?badnick command: ?badnick add/del nick } if ($2 == add) { writeini badnicks.ini $chan $3 $3 | .msg $chan %logo.l Bad Nick $3 %logo.r Added to bad nicks list for %logo.l $chan %logo.r } if ($2 == del) { remini badnicks.ini $chan $3 | .msg $chan %logo.l Bad Nick $3 %logo.r Removed from bad nicks list for %logo.l $chan %logo.r } } if ($+(%trigger,ban) == $strip($1)) { if (!$3) { eis | .msg $chan ?ban command: ?ban add/del nick reason } if ($2 == add) { ban -ku600 $chan $3 $4- | .msg $chan Banned %logo.l $3 %logo.r time %logo.l 15 Minute Ban %logo.r reason %logo.l $4- %logo.r } if ($2 == del) { mode $chan -b $gettok($read(banned.txt, w, * $+ $3- $+ *),6,32) | .msg $chan Unbanned %logo.l $3 %logo.r } } if ($+(%trigger,baninfo) == $strip($1)) { if (!$2) { eis | .msg $chan ?baninfo command: ?baninfo total/banmask | halt } if ($2 == total) { .msg $chan %logo.l Total Bans %logo.r $lines(banned.txt) | halt } if (!$read(banned.txt, w, * $+ $2- $+ *)) { .msg $chan No Such Ban Exists. | halt } else { .msg $chan $read(banned.txt, w, * $+ $2- $+ *) | halt } } if ($+(%trigger,bigflood) == $strip($1)) { if (!$2) { eis | .msg $chan ?bigflood command: ?bigflood on/off/status $chr(35) | .msg $chan example: ?flood on 200 ( 200 characters per message sent ) } if ($2 == on) { set $+(%,$chan,bflood) on set $+(%,$chan,bigflood) $3 .msg $chan %logo.l $chan Big Flood Protect %logo.r is now On: $3 } if ($2 == off) { set $+(%,$chan,bflood) off | .msg $chan %logo.l $chan Big Flood Protect %logo.r is now Off } if ($strip($2) == status) { .msg $chan %logo.l $chan Big Flood Protect %logo.r is currently: $($+(%,$chan,bflood),2) } } if ($+(%trigger,flood) == $strip($1)) { if (!$2) { eis | .msg $chan ?flood command: ?flood on/off/status #:# | .msg $chan example: ?flood on 10:3 ( 10 messages in 3 seconds ) } if ($2 == on) { set $+(%,$chan,floodlines) $gettok($3,1,58) set $+(%,$chan,floodin) $gettok($3,2,58) set $+(%,$chan,flood) on .msg $chan %logo.l $chan Flood Protect %logo.r is now On: $3 } if ($2 == off) { set $+(%,$chan,flood) off | .msg $chan %logo.l $chan Flood Protect %logo.r is now Off } if ($strip($2) == status) { .msg $chan %logo.l $chan Flood Protect %logo.r is currently: $($+(%,$chan,flood),2) } } if ($+(%trigger,flyby) == $strip($1)) { if (!$2) { eis | .msg $chan ?flyby command: ?flyby on/off/status | halt } if ($2 == on) { set $+(%,$chan,flyby) on | .msg $chan %logo.l $chan Fly By %logo.r is now On } if ($2 == off) { set $+(%,$chan,flyby) off | .msg $chan %logo.l $chan Fly By %logo.r is now Off } if ($strip($2) == status) { .msg $chan %logo.l $chan Fly By %logo.r is currently $($+(%,$chan,flyby),2) } } if ($+(%trigger,greet) == $strip($1)) { if (!$2) { eis | .msg $chan ?greet command: ?greet on/off message } if ($2 == on) { set $+(%,greet,$chan) on | set $+(%,joingreet,$chan) $3- | .msg $chan Added %logo.l $3- %logo.r as %logo.l $chan %logo.r auto greet message. } if ($2 == off) { unset $+(%,greet,$chan) | .msg $chan Removed %logo.l $($+(%,joingreet,$chan),2) %logo.r as %logo.l $chan %logo.r auto greet message. } } if ($+(%trigger,kick) == $strip($1)) { if (!$3) { eis | .msg $chan ?kick command: ?kick nick reason } if ($3) { kick $chan $2 $3- | .msg $chan Kicked %logo.l $2 %logo.r from %logo.l $3 %logo.r } } if ($+(%trigger,modelock) == $strip($1)) { if (!$2) { eis | .msg $chan ?modelock command: ?modelock list/modes } if ($2 == list) { .msg $chan %logo.l Enforcing Modes %logo.r for %logo.l $chan %logo.r $gettok($readini(users.ini,modelock,$chan),2-,32) | halt } else { writeini users.ini modelock $chan $chan $2- | mode $chan $2- | .msg $chan Mode %logo.l $2- %logo.r added to %logo.l $chan %logo.r } } if ($+(%trigger,protect) == $strip($1)) { if (!$2) { eis | .msg $chan ?protect command: ?protect on/off } if ($2 == on) { set $+(%,protect,$chan) on | .msg $chan %logo.l $chan Protection %logo.r is now On } if ($2 == off) { unset $+(%,protect,$chan) | .msg $chan %logo.l $chan Protection %logo.r is now Off } } if ($+(%trigger,remuser) == $strip($1)) { if (!$3) { eis | .msg $chan ?remuser command: ?remuser nick chan } else { remini $+($network,users.ini) $3 $2 | mode $3 -aohv $2 $2 $2 $2 | .msg $chan %logo.l $2 %logo.r removed from %logo.l $3 %logo.r access. } } if ($+(%trigger,spam) == $strip($1)) { if (!$2) { eis | .msg $chan ?spam command: ?spam on/off/status } if ($regex($strip($1-),/on|off/i)) { set $+(%,sp,$chan) $2 | .msg $chan %logo.l $chan Spam Protect %logo.r is now $($+(%,sp,$chan),2) $+ . } if ($strip($2) == status) { .msg $chan %logo.l $chan Spam Protect %logo.r is currently: $($+(%,sp,$chan),2) } } if ($+(%trigger,topiclock) == $strip($1)) { if (!$2) { eis | .msg $chan ?topiclock command: ?topiclock on/off topic } if ($2 == on) { if (!$3) { eis | .msg $chan ?topiclock command: ?topiclock on/off topic } else { set $+(%,topic,$chan) $3- | set $+(%,topiclock,$chan) on | topic $chan $3- | .msg $chan %logo.l $chan Topiclock %logo.r On } } if ($2 == off) { unset $+(%,topiclock,$chan) | .msg $chan %logo.l $chan Topiclock %logo.r Off | halt } } } ; ; Bot Talk ; if ($me == $strip($1)) && ($right($strip($1-),1) == ?) { if (are you a bot isin $strip($1-)) { .msg $chan Of course I am! } if (annoying you isin $strip($1-)) { .msg $chan Most definitly $+($nick,!) Make them stop! | halt } set -u5 %randadv $rand(1,8) if (%randadv == 1) { .msg $chan What, You cant make decisions for yourself? } if (%randadv == 2) { .msg $chan I wouldn't tell you if i knew. } if (%randadv == 3) { .msg $chan Ask someone who cares. } if (%randadv == 4) { .msg $chan I cant believe you just asked that!!! } if (%randadv == 5) { .msg $chan Come back when Im not so drunk. } if (%randadv == 6) { .msg $chan What sort of question is that? } if (%randadv == 7) { .msg $chan Are you serious? } if (%randadv == 8) { .msg $chan You shouldn't be asking questions like that!! } } ; ; Trigger flood ; if ($left($1,1) == $($+(%,trigger),2)) { inc -u10 $+(%,trigger,$nick) } ; ; Spam Catcher ; if ($regex($strip($1-),/\b(?:http|www|com|org|net)\b/i)) && ($($+(%,sp,$chan),2) == on) { if ($+(%,spam,$nick) == $null) { set $+(%,spam,$nick) 1 } else { inc $+(%,spam,$nick) 1 } if ($($+(%,spam,$nick),2) == 3) { unset $+(%,spam,$nick) | ban -ku300 $chan $nick 2 Spam/Advertising. | .notice $nick You have been banned from %logo.l $chan %logo.r for Spam/Advertising. } .msg $chan %logo.l $nick %logo.r Spamming is not allowed in this channel. } } /* Aliases */ alias addowner { notify $1 | writeini $+($network,users.ini) botmaster $1 $1 $address($1,2) | .msg $chan %logo.l $gettok($readini($+($network,users.ini),botmaster,$1),1,32) %logo.r added to %logo.l Master List %logo.r } alias eis { .msg $chan **** %logo.lIncorrect Syntax %logo.r ***** } alias io { .msg $chan **** %logo.lIllegal Operation %logo.r ***** } alias ircopscan { if ($nick($1,0) > 1000) { .msg %chkchan %logo.l IRCop Scan %logo.r halted - too many users on channel. } else { .who $1 | set $+(%,ircopcheck,$1) 1 } } alias chkflyby { var %a = 1 var %b = $comchan($nick,0) while %a <= %b { if ($($+(%,join,$comchan($nick,%a),$nick),2) == $nick) { $iif($+(%,flyby,$comchan($nick,%a)),inc $+(%,flyby,$comchan($nick,%a)),set $+(%,flyby,$comchan($nick,%a)) 1) | ban -u300 $comchan($nick,%a) $nick 2 Fly-By Protect | .msg $comchan($nick,%a) %logo.l $($+(%,join,$comchan($nick,%a),$nick),2) %logo.r was Fly-By %logo.l $($+(%,flyby,$comchan($nick,%a)),2) %logo.r Since $($+(%,botstartdate),2) | halt } else { inc %a } } } alias relayevent { var %a = $scon(0) while (%a) { if ($scon(%a).network == $1) { dec %a } else { scon %a msg %rchan $2- | dec %a } } } alias global { scon -a //ame %logo.l Global Service Message %logo.r from %logo.l $m1 %logo.r on %logo.l $network %logo.r scon -a //ame %logo.l $1 %logo.r $2- } /* Raw Events */ raw 315:*: { if ($($+(%,ircopcheck,%chkchan1),2) != $null) { if ($($+(%,ircops,%chkchan1),2) != $null) { .msg %msgchan %logo.l IRCops %logo.r on %chkchan1 $+ : $($+(%,ircops,%chkchan1),2) $+ . } else { .msg %msgchan %logo.l IRCop Scan %logo.r No IRCops on %chkchan1 $+ . } unset %ircop* | .haltdef } } raw 352:*: { if ($($+(%,ircopcheck,%chkchan1),2) != $null) { if (* isin $7) { set $+(%,ircops,%chkchan1) $($+(%,ircops,%chkchan1),2) $6 } .haltdef } } /* Menu */ menu channel,nicklist { Server relay .Set Relay Channel:set %rchan $$?"Channel name: example: #Help" .Relay Currently %serverrelay:set %serverrelay $iif((%serverrelay == on),off,on) | echo -a ***** Sever Relay is now %serverrelay Add/Delete channel access .Add $$1 as owner:writeini $+($network,users.ini) $chan $address($$1,2) OWNER | mode $chan +q $$1 | .msg $chan Added %logo.l $$1 %logo.r as %logo.l $chan %logo.r Owner. .Add $$1 as admin:writeini $+($network,users.ini) $chan $address($$1,2) ADMIN | mode $chan +a $$1 | .msg $chan Added %logo.l $$1 %logo.r as %logo.l $chan %logo.r Admin. .Add $$1 as op:writeini $+($network,users.ini) $chan $address($$1,2) OP | mode $chan +o $$1 | .msg $chan Added %logo.l $$1 %logo.r as %logo.l $chan %logo.r Op. .Add $$1 as helper:writeini $+($network,users.ini) $chan $address($$1,2) HELPER | mode $chan +h $$1 | .msg $chan Added %logo.l $$1 %logo.r as %logo.l $chan %logo.r Helper. .Add $$1 as voice:writeini $+($network,users.ini) $chan $address($$1,2) VOICE | mode $chan +v $$1 | .msg $chan Added %logo.l $$1 %logo.r as %logo.l $chan %logo.r Voice. .Delete $$1:remini $+($network,users.ini) $chan $$1 Global Message:global $$?"Message From" $$?"Message" Logo .Logo Left: set %logo.l $$?"" .Logo Right: set %logo.r $$?"" }
  22. chain

    Window Dialog

    met dit script heb je een klein overzicht van wat er gebeurt in je kanaal. je kan zien wie er voice/devoice/halfop/dehalfop/op/deop/owner/deowner krijgt in de kanalen waar je online bent je kan ook zien wie er een kick/ban/unban zet of krijgt je krijgt ook alle notice Berichten in een apart venster als je die heeft geactiveert dit Commando werkt uitendelijk ook met een on off modus dus als je deze wilt gebruiken zal je het moeten activeren als je niet wilt gebruiken dan moet je het desactiveren, je kan zelfs kiezen wat er aan of uit staat als de bepaalde funktie gedesactiveerd is, dan zal je er geen melding krijgen in een apart venster als de funktie geactiveerd is dan zal de window meteen mee opstarten bij het opstarten van uw mIRC in een aparte venster ik wens jullie alvast veel plezier met dit script! ;===================================================== ; ChatToIRC ; DIVERSE ZAKEN VOOR ChatToIRC ;===================================================== ;===================================================== ; Auteur: JamesBond ; Homepagina: https://chatplezier.com ; Netwerk: ChatPlezier ; Server: irc.chatplezier.com ; Email: jamesbond@chatplezier.com ;===================================================== alias ChatToIRC-Ops { dialog -dm ChatToIRC-ops ChatToIRC-ops } dialog ChatToIRC-Ops { title " ChatToIRC Ops Menu" size -1 -1 140 90 icon $icodir(emoticon.ico), 0 noborder option dbu tab "Notices", 1, 2 1 135 85 tab "Channels", 2 tab "Kicks/Bans", 3 tab "Clones", 4 button " Aanzetten", 7, 30 20 70 10,tab1 button " Uitzetten", 8, 30 40 70 10,tab1 button " Aanzetten", 9, 30 20 70 10,tab2 button " Uitzetten", 10, 30 40 70 10,tab2 button " Aanzetten", 11, 30 20 70 10,tab3 button " Uitzetten", 12, 30 40 70 10,tab3 button " Aanzetten", 13, 30 20 70 10,tab4 button " Uitzetten", 14, 30 40 70 10,tab4 button " Sluiten", 19, 30 60 70 10,ok } on *:dialog:ChatToIRC-Ops:sclick:7:{ .set %Notices On | .set %Notices 1 | /window -n @Notice | echo -a 0,4 @Notices 0,12 Berichten Staat Nu AaN 0 } on *:dialog:ChatToIRC-Ops:sclick:8:{ .set %Notices Off | .set %Notices 0 | /window -c @Notice | echo -a 0,4 @Notices 0,12 Berichten Staat Nu UiT 0 } on *:dialog:ChatToIRC-Ops:sclick:9:{ .set %Channels On | .set %Channels 1 | /window -n @Channels | echo -a 0,4 @Channels 0,12 Berichten Staat Nu AaN 0 } on *:dialog:ChatToIRC-Ops:sclick:10:{ .set %Channels Off | .set %Channels 0 | /window -c @Channels | echo -a 0,4 @Channels 0,12 Berichten Staat Nu UiT 0 } on *:dialog:ChatToIRC-Ops:sclick:11:{ .set %Kicks/Bans On | .set %Kicks/Bans 1 | /window -n @Kicks/Bans | echo -a 0,4 @Kicks/Bans 0,12 Berichten Staat Nu AaN 0 } on *:dialog:ChatToIRC-Ops:sclick:12:{ .set %Kicks/Bans Off | .set %Kicks/Bans 0 | /window -c @Kicks/Bans | echo -a 0,4 @Kicks/Bans 0,12 Berichten Staat Nu UiT 0 } on *:dialog:ChatToIRC-Ops:sclick:13:{ .set %Clones On | .set %Clones 1 | /window -n @Cloons | echo -a 0,4 @Clones 0,12 Berichten Staat Nu AaN 0 } on *:dialog:ChatToIRC-Ops:sclick:14:{ .set %Clones Off | .set %Clones 0 | /window -c @Cloons | echo -a 0,4 @Clones 0,12 Berichten Staat Nu UiT 0 } on 1:START:{ if (%Notices == 1) { echo -m Notices Window 3Active | /window -n @Notice } if (%Channels == 1) { echo -m Channels Window 3Active | /window -n @Channels } if (%Kicks/Bans == 1) { echo -m Kicks/Bans Window 3Active | /window -n @Kicks/Bans } if (%Clones == 1) { echo -m Clones Window 3Active | /window -n @Cloons } } on *:NOTICE:*:*: { if (%Notices == 1) { if ($window(Notice)) && ($nick != $me) { /window -m @Notice /aline -n @Notice @Notice | echo @Notice 10[ $+ $time $+ ]12[ $+ $date $+ ]13 $network 10[NOTICE] 4 $+ $nick 1stuurde je net notice 4Bericht:12 } elseif ($nick != $me) { /window -m @Notice /aline -n @Notice @Notice | echo @Notice 10[ $+ $time $+ ]12[ $+ $date $+ ]13 $network 10[NOTICE] 4 $+ $nick 1stuurde je net notice 4Bericht:12 $1- } } } on 1:BAN:#:{ if (%Kicks/Bans == 1) { if ($me isin $nick) { Halt } /window -m @Kicks/Bans /aline -n @Kicks/Bans @Kicks/Bans | echo @Kicks/Bans 10[ $+ $time $+ ]12[ $+ $date $+ ] 10[BAN]14 $chan 4 $+ $nick 12zet mode4 $1- } } on 1:UNBAN:#:{ if (%Kicks/Bans == 1) { if ($me isin $nick) { Halt } /window -m @Kicks/Bans /aline -n @Kicks/Bans @Kicks/Bans | echo @Kicks/Bans 10[ $+ $time $+ ]12[ $+ $date $+ ] 10[UNBAN]14 $chan 4 $+ $nick 12zet mode4 $1- } } on 1:KICK:#:{ if (%Kicks/Bans == 1) { if ($me isin $nick) { Halt } /window -m @Kicks/Bans /aline -n @Kicks/Bans @Kicks/Bans | echo @Kicks/bans 10[ $+ $time $+ ]12[ $+ $date $+ ] 4[KICK]14 $chan 4 $+ $nick 2kick 6 $+ $knick 12 $1- } } on 1:VOICE:#:{ if (%Channels == 1) { if ($me isin $nick) { Halt } /window -m @Channels /aline -n @Channels @Channels | echo @Channels 10[ $+ $time $+ ]12[ $+ $date $+ ] 10[VOICE]14 $chan 4 $+ $nick 7voice12 $vnick } } on 1:DEVOICE:#:{ if (%Channels == 1) { if ($me isin $nick) { Halt } /window -m @Channels /aline -n @Channels @Channels | echo @Channels 10[ $+ $time $+ ]12[ $+ $date $+ ] 10[Devoice]14 $chan 4 $+ $nick 7devoice12 $vnick } } on 1:HELP:#:{ if (%Channels == 1) { if ($me isin $nick) { Halt } /window -m @Channels /aline -n @Channels @Channels | echo @Channels 10[ $+ $time $+ ]12[ $+ $date $+ ] 10[HALFOP]14 $chan 4 $+ $nick 7halfop12 $hnick } } on 1:DEHELP:#:{ if (%Channels == 1) { if ($me isin $nick) { Halt } /window -m @Channels /aline -n @Channels @Channels | echo @Channels 10[ $+ $time $+ ]12[ $+ $date $+ ] 10[DEHALFOP]14 $chan 4 $+ $nick 7Dehalfop12 $hnick } } on 1:OP:#:{ if (%Channels == 1) { if ($me isin $nick) { Halt } /window -m @Channels /aline -n @Channels @Channels | echo @Channels 10[ $+ $time $+ ]12[ $+ $date $+ ] 10[OP]14 $chan 4 $+ $nick 7op12 $opnick } } on 1:DEOP:#:{ if (%Channels == 1) { if ($me isin $nick) { Halt } /window -m @Channels /aline -n @Channels @Channels | echo @Channels 10[ $+ $time $+ ]12[ $+ $date $+ ] 10[DEOP]14 $chan 4 $+ $nick 7deop12 $opnick } } on 1:OWNER:#:{ if (%Channels == 1) { if ($me isin $nick) { Halt } /window -m @Channels /aline -n @Channels @Channels | echo @Channels 10[ $+ $time $+ ]12[ $+ $date $+ ] 10[OWNER]14 $chan 4 $+ $nick 7owner12 $opnick } } on 1:DEOWNER:#:{ if (%Channels == 1) { if ($me isin $nick) { Halt } /window -m @Channels /aline -n @Channels @Channels | echo @Channels 10[ $+ $time $+ ]12[ $+ $date $+ ] 10[DEOWNER]14 $chan 4 $+ $nick 7deowner12 $opnick } } ###HL on *:Join:#: { if (%Clones == 1) { var %host_to_search_for = $address($nick,2) var %number_from_that_host = $ialchan(%host_to_search_for,$chan,0) if (%number_from_that_host > 1) { ;we have clones! ;first set up our vars and loop var %count = 0 unset %clones :loop inc %count ;loop through every nick, adding the nicks to %clones var %clones = %clones $ialchan(%host_to_search_for,$chan,%count).nick if (%count < %number_from_that_host) { goto loop } /window -m @Cloons //aline -n @Cloons @Cloons | echo @Cloons 10[ $+ $time $+ ]12[ $+ $date $+ ] 10[CLOONS] 12op 14 $+ $chan 4 $+ %count $+ 7-Cloons Gedetecteerd- 12Cloons Van 4 $+ $address($nick,2) //aline -n @Cloons @Cloons | echo @Cloons 10[ $+ $time $+ ]12[ $+ $date $+ ] 10[Nick Cloons] 12op 14 $+ $chan $+ :12 %clones } } } alias open { .window -ekn @Services 0 0 718 504 @Services Comic Sans MS 11 .window -ekn @Notice 0 0 718 504 @Notice Courier New 10 } On ^*:NoticE:*:#: { if (%Notices == 1) { if ($nick isop $comchan($nick,1)) || ($nick isvo $comchan($nick,1)) { goto n } if ($nick == chanserv) || ($nick == memoserv) || ($nick == operserv) || (nickserv == $nick) { .echo @Services [ $nick $+ : $+ $chan ] $1- | halt } else { .echo @Notice 10[ $+ $time $+ ]12[ $+ $date $+ ]13 $network 10[NOTICE] 4 $+ $nick 1 - $+ $chan $+ - $1- | halt } else { .echo @Notice Notice $nick - $+ $chan $+ - $1- | halt } :n } } On ^*:NoticE:*:?: { if (%Notices == 1) { if ($nick isop $comchan($nick,1)) || ($nick isvo $comchan($nick,1)) { goto n } if ($nick == chanserv) || ($nick == memoserv) || ($nick == operserv) || (nickserv == $nick) { .echo @Services [ $nick ] $1- | halt } else { .echo @Notice Notice $nick -Private- $1- | halt } :n } } alias faddr { if (!$window(@Address)) { window -azdBke2 @Address $calc($window(-1).w /2 -250) $calc($window(-1).h /2 -125) 500 250 } if ($1) { search.addr $1- } } on *:INPUT:@Address: { if ($left($1,1) != /) && (!$ctrlenter) { search.addr $1- } } alias search.addr { var %:adr = $1-, %:a = 1 aline -h @Address $chr(160) $iif($ial(%:adr,0),aline -h 4 @Address %:adr $+($chr(40),$v1,$chr(41)) on $network is:,aline -h 4 @Address %:adr no address found on $network) while (%:a <= $ial(%:adr,0)) { aline -h 15 @Address $+(%:a,$chr(41)) $+(14,$ial(%:adr,%:a).nick,) - $ial(%:adr,%:a).addr inc %:a }
  23. menu nicklist { comchan kick:{ var %x 1 while ($comchan($$1,%x)) { kick # $ifmatch | inc %x } } } .Twat-B-Gone: .msg Chanserv Kick $chan $1 you've been sparyed with industrial strength Twat-B-Gone(Kick #1). .Fuck Your Self: .msg Chanserv kick $chan $1 go outside and play hide and go fuck yourself(Kick #2). .your momma's bra: .msg Chanserv kick $chan $1 tell your mom can have her bra back im done using it for a sling shot(Kick#3). .Used tampon: .msg Chanserv kick $chan $1 slapped you with a used tampon ewwwwww(Kick#4). .Emo Kick: .msg chanserv kick $chan $1 Why dont you go outside and play hide and go cut yourself(Kick#5). .Caps kick: .msg chanserv kick $chan $1 Turn off your Caps lock(kick#6). .Pming Without Permission: .msg chanserv kick $chan $1 Dont Pm ppl without permission(Kick#7). .Age Upon Entry: .msg chanserv kick $chan $1 State your Age upon Entry(kick#8). .Racist: .msg chanserv kick $chan $1 Racist language will not be tolerated(kick#9). .Trolling: .msg chanserv kick $chan $1 Dont Trolls Live Under Bridges(kick#10). .Under Age: .msg chanserv kick $chan $1 Come Back When your balls drop(kick#11). .Guest Nick: .msg chanserv kick $chan $1 Get A proper nick plz type /nick <newnickhere>(Kick#12). . }
  24. chain

    Kicks Informatifs

    Voici un script tout à fait simple à utiliser que j'ai écrit pour les opérateurs français sur mIRC. Je n'ai rajouté aucune contrainte de 'iff.' Si vous en voudriez une, vous pouvez me laisser un commentaire. Si vous faites un copier-coller de ceci dans la section de remotes, vous pourrez cliquer à droite sur un nom dans la liste de pseudos et les contrôler par ce script. (Le dernier kick peut être facilement effacé, si vous ne gérez pas un tchat uniquement en français.) ;Kicks Informatifs ;De: ZéléSansLogique alias kick: /kick $active $1 $2- menu nicklist { Kicks Informatifs .Personaliser:/kick # $1 $?="Raison" .Surveiller le langage:/kick # $1 Surveillez votre langage !!! .Activité Sexuelle:/kick # $1 Il est permis de blaguer, toutefois ne soyez pas trop grossier(ière)!!! .Floode:/kick # $1 Ne Floodez Pas. .Perturber:/kick # $1 Ne soyez pas un perturbateur/trice. .Menace:/kick # $1 Ne menacez personne. .Agacement:/kick # $1 Vous avez été kické comme vous agaciez. .Vengance:/kick # $1 Merci d'avoir tenté de jouer !!! .Langue à part le français:/kick # $1 S'il vous plaît, essayez de votre vieux de parler en français sur ce salon }
  25. My first snippet on hawkee ^^ Just a simple nicklist script with a few funny kicks i made while being bored in my room on Buzz. Some strong language used in these. Lolz Just copy and paste in remote as new. The coding fits for my room and the server. Some changes may be needed to fit your needs. enjoy. and yes there is an old msn based middle finger kick in here. -.- menu nicklist { Kicklist . Quick kicks ..Quick Kick:/kick # $$1 Bye! ..Loser:/kick # $$1 Lata Loser! :~ ..FFS:/kick # $$1 FFS go the fuck away!! 8-) ..Duck my Sick:/msg $chan Duck my sick biotch! | /msg $chan In other words.... | /kick # $$1 SUCK MY DICK BITCH!! :@ ..Suck it:/msg $chan :o OMG $$1 !! | /msg $chan How dare you whisper that to me! | /msg $chan No i dont want to suck on your bity thingies and no you cant suck on my toes!! | /kick # $$1 go find someone else to play with sicko!! :@ ..Just go away:/msg $chan 8-) | /kick # $$1 Just go the fuck away!! . Mean Kicks ..Fuck Off:/msg $chan S eTahoma;0 .................__ | /msg $chan S eTahoma;0 .............../'_/) | /msg $chan S eTahoma;0 ............,/.../ / | /msg $chan S eTahoma;0 .........../..../ / | /msg $chan S eTahoma;0 ...../'--/'...'/'-.'.. | /msg $chan S eTahoma;0 ../'/.../..../.....:.--\ | /msg $chan S eTahoma;0 ('(...'...'.... -_/'...'/ | /msg $chan S eTahoma;0 .\.................'...../ | /msg $chan S eTahoma;0 ..'\'...\.......... _..' | /msg $chan S eTahoma;0 ....\..............( | /msg $chan S eTahoma;0 ......\.............\ | /kick # $$1 FUCK OFF!!! ..Matrix:/msg # S \rTahoma;0 Wake up Neo... | /msg # S \rTahoma;0 The Matrix has you... | /msg # S \rTahoma;0 Follow The White Rabbit... | timer1 1 4 kick $!comchan($me,1) $$1 It Went Thata Way (b^) ----> ..Kotex: /msg $chan Wahhhhh :'( i thought only bitches got their rag | /msg $chan Oh...wait...thats right...You ARE a bitch 8-) | /kick # $$1 Get a Fucking KOTEX and clean up this mess!! :@ ..Village Idiot:/msg $chan Hey $$1, your village called. | /msg $chan They said they want their idiot back. | /me grabs $$1 and stuffs em in a box then calls UPS (o) (ap) | /kick # $$1 bon voyage $$1 !! :~ . Mafia Kicks ..Mafia lag: { msg $chan Yo $$1 whodafuck you think you lookin at? ^o) | timer1 1 7 msg $chan $$1 i know that cho aint lookin at ME | timer2 1 14 msg $chan Whodafuck you tink you are, lookin at me like dat? | timer3 1 21 msg $chan $$1 You betta watch whodafuckyou lookin at kid 8o| | timer4 1 28 msg $chan I told you not ta be lookin at me...what are you, stupid or sumptin? | timer5 1 35 msg $chan $$1 Yur askin fur it!!! :@ | timer6 1 42 /kick # $$1 Fuck you and ya lazy eye bitch! } ..Fish:/msg $chan <o))))>< | /msg $chan <o))))>< <o))))>< | /msg $chan <o))))>< <o))))>< <o))))>< | /msg $chan <o))))>< <o))))>< <o))))>< <o))))>< | /msg $chan <o))))>< <o))))>< <o))))>< <o))))>< <o))))>< | /kick # $$1 Time to Sleep wit da fishes mutherfucka!! . Pirate Kicks ..Bitchery:/msg $chan avast ye scurvy dogs! | /msg $chan No bitches be allowed 'ere on the Dragon Archadia, and ye have bean accused of bitchery by yur peers! | /msg $chan $$1 Wuz found guilty of all charges! | /msg $chan Time fer u 2 walk dee plank! | /kick # $$1 now get the fuck off my ship!! :@ ..Pirate's Life:/msg $chan Yo Ho, Yo ho! | /msg $chan A pirate's life for me!! | /msg $chan Yo ho, Yo ho! | /kick # $$1 A Pirate's Bitch ye be!! (as) ..Bitch canon:/msg $chan Argh matey! | /msg $chan Ye be the biggest bitch ta ever sail the seven seas! | /me grabs $$1 and stuffs them into the Bitch cannon | /kick # $$1 BOOOOOM!! :~ :~ - }
×
×
  • Create New...