Heres my IRC Code:
Code: Select all
*/ Gaming Script by Matt Milligan (mil1i)
*/ September 26, 2004
*/
*/
*/ Load script setting up var's
on 1:load:{
if (!%chans) { /set %chans $?="What's the channel you wish for this script to run in? (ex. #openfire)" }
elseif (!%id) { /set %id $?="What prefix do you want to use to execute commands? (ex. @commands [or] ?commands)" }
elseif (!%mode) { /set %mode /notice }
elseif (!%adbanhistory) { /set %adbanhistory 0 }
}
*/
*/ Auto-Join Channels bot is working in
*/
on 1:start:/j %chans
*/
*/ Unwanted advertising prevention
*/
*/
on 1:text:*#*:%chans:{
if (($nick !isvoice $chan) && ($nick !isop $chan)) {
/inc %adbanhistory 1
/ban -u240 %chans $nick 3
/kick $chan $nick Do NOT adverstise. ( $+ %adbanhistory $+ users.)
}
}
on 1:action:*#*:%chans:{
if (($nick !isvoice $chan) && ($nick !isop $chan)) {
/inc %adbanhistory 1
/ban -u240 %chans $nick 3
/kick $chan $nick Do NOT adverstise. ( $+ %adbanhistory $+ users.)
}
}
*/
*/ Public Commands
*/
*/
on 1:text:*:%chans:{
if (($flood(chanflood, $nick, $chan, 4, 4, 1) == f) && ($nick !isop $chan)) {
/ban -u350 $chan $nick 3
/mode $chan +m
/timerum 1 10 mode $chan -m
}
elseif ((%id == $left($1, $calc($len($1) - $calc($len($1) - 1)))) && ($nick isop $chan)) {
if ($right($1, $calc($len($1) - 1)) == commands) {
/msg $chan Commands: $iif(%roster, $+ %id $+ Roster), $iif(%record, $+ %id $+ Record), $iif(%sponsors, $+ %id $+ Sponsors), $iif(%website, $+ %id $+ Website), $iif(%server, $+ %id $+ Server), $iif(%cal, $+ %id $+ CAL), $iif(%ugs, $+ %id $+ UGS)
/timeradmin 1 1 notice $nick $chr(34) $+ $+ %id $+ Set <cmd> <text> $+ $chr(34) - To change any of the above responses. ( $+ %id $+ Set mode <Pub/Priv>) - Pub = msg chan - Priv = notice nick
}
elseif ($right($1, $calc($len($1) - 1)) == help) {
/msg $chan Commands: $iif(%roster, $+ %id $+ Roster), $iif(%record, $+ %id $+ Record), $iif(%sponsors, $+ %id $+ Sponsors), $iif(%website, $+ %id $+ Website), $iif(%server, $+ %id $+ Server), $iif(%cal, $+ %id $+ CAL), $iif(%ugs, $+ %id $+ UGS)
/timeradmin 1 1 notice $nick $chr(34) $+ $+ %id $+ Set <cmd> <text> $+ $chr(34) - To change any of the above responses. ( $+ %id $+ Set mode <Pub/Priv>) - Pub = msg chan - Priv = notice nick
}
elseif ($right($1, $calc($len($1) - 1)) == roster) {
%mode $iif(%mode == /msg, $chan, $nick) Roster: %roster
}
elseif ($right($1, $calc($len($1) - 1)) == sponsors) {
%mode $iif(%mode == /msg, $chan, $nick) Sponsors: %sponsors
}
elseif ($right($1, $calc($len($1) - 1)) == website) {
%mode $iif(%mode == /msg, $chan, $nick) Website: %website
}
elseif ($right($1, $calc($len($1) - 1)) == cal) {
%mode $iif(%mode == /msg, $chan, $nick) CAL: %cal
}
elseif ($right($1, $calc($len($1) - 1)) == ugs) {
%mode $iif(%mode == /msg, $chan, $nick) UGS: %ugs
}
elseif ($right($1, $calc($len($1) - 1)) == server) {
%mode $iif(%mode == /msg, $chan, $nick) Server: %server
}
elseif ($right($1, $calc($len($1) - 1)) == record) {
%mode $iif(%mode == /msg, $chan, $nick) Record: %record
}
elseif ($right($1, $calc($len($1) - 1)) == set) {
if ($2 == mode) {
if ($3 == pub) {
/set %mode /msg
/notice $nick Commands will now be displayed Publicly.
}
elseif ($3 == priv) {
/set %mode /notice
/notice $nick Commands will now be displayed Privately.
}
else {
/notice $nick Error: Must use "Pub" or "Priv" to change. (ex. %id $+ set mode pub)
}
}
elseif (($2 == roster) || ($2 == record) || ($2 == sponsors) || ($2 == website) || ($2 == server) || ($2 == cal) || ($2 == ugs)) {
/set $chr(37) $+ $2 $3-
/notice $nick Changed to - $+ $upper($left($2,1)) $+ $lower($right($2, $calc($len($2) - 1))) $+ : $3-
}
else {
/notice $nick $+ $upper($left($2,1)) $+ $lower($right($2, $calc($len($2) - 1))) $+ - is not a command.
}
}
}
elseif ((%id == $left($1, $calc($len($1) - $calc($len($1) - 1)))) && ($nick !isop $chan)) {
if ($right($1, $calc($len($1) - 1)) == commands) {
/msg $chan Commands: $iif(%roster, $+ %id $+ Roster), $iif(%record, $+ %id $+ Record), $iif(%sponsors, $+ %id $+ Sponsors), $iif(%website, $+ %id $+ Website), $iif(%server, $+ %id $+ Server), $iif(%cal, $+ %id $+ CAL), $iif(%ugs, $+ %id $+ UGS)
}
elseif ($right($1, $calc($len($1) - 1)) == help) {
/msg $chan Commands: $iif(%roster, $+ %id $+ Roster), $iif(%record, $+ %id $+ Record), $iif(%sponsors, $+ %id $+ Sponsors), $iif(%website, $+ %id $+ Website), $iif(%server, $+ %id $+ Server), $iif(%cal, $+ %id $+ CAL), $iif(%ugs, $+ %id $+ UGS)
}
elseif ($right($1, $calc($len($1) - 1)) == roster) {
%mode $nick Roster: %roster
}
elseif ($right($1, $calc($len($1) - 1)) == sponsors) {
%mode $iif(%mode == /msg, $chan, $nick) Sponsors: %sponsors
}
elseif ($right($1, $calc($len($1) - 1)) == website) {
%mode $iif(%mode == /msg, $chan, $nick) Website: %website
}
elseif ($right($1, $calc($len($1) - 1)) == cal) {
%mode $iif(%mode == /msg, $chan, $nick) CAL: %cal
}
elseif ($right($1, $calc($len($1) - 1)) == ugs) {
%mode $iif(%mode == /msg, $chan, $nick) UGS: %ugs
}
elseif ($right($1, $calc($len($1) - 1)) == server) {
%mode $iif(%mode == /msg, $chan, $nick) Server: %server
}
elseif ($right($1, $calc($len($1) - 1)) == record) {
%mode $iif(%mode == /msg, $chan, $nick) Record: %record
}
}
}
;$flood 1.2 script
;Elfrond - 2002
;usage: $flood(<description>,<nick|address>,<#channel|query|dcc>,<max>,<secs>,<inc>)
alias flood {
var %y = $+(f,$cid,,$$1,,$$2,,$$3)
hadd $+(-mu,$$5) %y $ticks $$6
var %i = $hget(%y,0).item
var %x
while (%i) {
inc %x $hget(%y,%i).data
dec %i
}
if (%x >= $4) return f
}
- kick/timebans someone from a channel for spamming their channel name
- bans (without kicking) and sets mode (+m) in chan for text spam of 5 lines in 2 secconds
- .command script (with a set command, to change the variables it displays, along with a different menu for channel ops)
I made an attempt to start this in TCL, but it's not working to well so far...
here is what I have:
Code: Select all
#Gaming Script for clans beta1 by mil1i.
#Objective: to act as a spamblocker/channel advertisement stopper and clanbot.
#Usage: !explain explination
### VARIABLES ###
set commandv "?Roster ?Record ?Server ?Sponsors ?Webstie ?CAL ?UGS"
set rosterv "socrat3s tr!cky sanct!on abuse mil1i t!poff muruko"
set recordv "CAL-O S12 : 3-0-0 UGS-O S7 : 1-1-0 Overall : 4-1-0"
set serversv "Nuclear Fallout Priv Server: happy.nuclearfallout.net:27015"
set sponsorsv "www.abusegaming.com"
set websitev "www.happy-gaming.com"
set ugsv "http://ugsleague.com/?lid=0&sid=clans&cid=21074"
set calv "http://caleague.com/?page=teams&teamid=16038"
### SCRIPT ###
bind pub - ?commands pub:commands
bind pub - ?roster pub:roster
bind pub - ?record pub:record
bind pub - ?servers pub:servers
bind pub - ?sponsors pub:sponsors
bind pub - ?website pub:website
bind pub - ?ugs pub:ugs
bind pub - ?cal pub:cal
bind pub - ?set pub:set
### OUTPUTS ###
proc pub:commands {nick uhost hand chan text} {
global botnick commandv
putquick "PRIVMSG $chan :$commandv"; return 0
}
proc pub:roster {nick uhost hand chan text} {
global botnick rosterv
putquick "NOTICE $nick :$rosterv"; return 0
}
proc pub:record {nick uhost hand chan text} {
global botnick recordv
putquick "NOTICE $nick :$recordv"; return 0
}
proc pub:servers {nick uhost hand chan text} {
global botnick serversv
putquick "PNOTICE $nick :$serversv"; return 0
}
proc pub:sponsors {nick uhost hand chan text} {
global botnick sponsorsv
putquick "NOTICE $nick :$sponsorsv"; return 0
}
proc pub:website {nick uhost hand chan text} {
global botnick websitev
putquick "NOTICE $nick :$websitev"; return 0
}
proc pub:ugs {nick uhost hand chan text} {
global botnick ugsv
putquick "NOTICE $nick :$ugsv"; return 0
}
proc pub:cal {nick uhost hand chan text} {
global botnick calv
putquick "NOTICE $nick :$calv"; return 0
}
#proc pub:set {nick uhost hand chan text} {
# global commandv rosterv recordv serversv sponsorsv websitev ugsv calv
# if {[isop $nick $chan]} {
# lset sponsorsv {} {Sponsors: $text}
# putquick "NOTICE $nick :Changed to - Sponsors: $text"; return 0
# }
#}
### CHANEL ADVERTISEMENT PROTECT ###
bind pubm - "*#*" pub:chanadvsm
proc pub:chanadvsm {nick uhost hand chan text {dest ""}} {
if {![isop $nick $chan]} {
pushmode $chan +b $nick
pushserv "BAN $chan $nick "
putkick $chan $nick "Do NOT advertise. Temp 5m Ban."; return 0
}
}
#bind act - "*#*" pub:actionadv
#bind notc - "*#*" pub:noticeadv
