| View previous topic :: View next topic |
| Author |
Message |
Sainted Voice
Joined: 16 Jun 2006 Posts: 3
|
Posted: Sun Jun 18, 2006 6:46 am Post subject: So what's up with all the cup modules? |
|
|
In the past people have been talking about cup scripts / modules for eggdrops. We used to have many cups in my channel (#Qlasics at quakenet), but we used a mirc script for this.
I am wondering if anyone is still working on such a script / module for eggdrop..
Last edited by Sainted on Tue Jun 20, 2006 4:18 am; edited 1 time in total |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Mon Jun 19, 2006 2:03 am Post subject: |
|
|
| What is a cop module supposed to be? And what do modules have to do with scripts? |
|
| Back to top |
|
 |
Sainted Voice
Joined: 16 Jun 2006 Posts: 3
|
Posted: Tue Jun 20, 2006 4:16 am Post subject: |
|
|
| MeTroiD wrote: | | What is a cop module supposed to be? And what do modules have to do with scripts? |
Oops sorry, typo I ment a cup module... But a module is about the same as a script right, or are there major differences? |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Tue Jun 20, 2006 4:52 am Post subject: |
|
|
Well.. I have started to make a cupbot script, this is what i have so far..
| Code: | namespace eval cupbot {
variable author "r0t3n"
variable version "1.03"
variable trigger "$"
variable adminflag "C|C"
bind pub $adminflag "${trigger}start" [namespace current]::start
bind pub $adminflag "${trigger}stop" [namespace current]::stop
bind pub $adminflag "${trigger}setmap" [namespace current]::setmap
bind pub $adminflag "${trigger}setprize" [namespace current]::setprize
bind pub $adminflag "${trigger}winner" [namespace current]::setwinner
bind pub -|- "${trigger}map" [namespace current]::map
bind pub -|- "${trigger}prize" [namespace current]::prize
}
setudef flag cup
setudef str cupadmin
setudef str cuptype
setudef int cupteams
setudef str cupprize
setudef str cupmap
setudef str cupwinner
proc cupbot::start {nickname hostname handle channel text} {
if {[channel get $channel cup]} {
putserv "NOTICE $nickname :There is already a cup in process with [channel get $channel cupadmin]."
} else {
set type [lindex [split $text] 0]
set teams [lindex [split $text] 1]
set map [lindex [split $text] 2]
if {$type == "" || $teams == ""} {
putserv "NOTICE $nickname :Usage: $::lastbind <type> <teams>."
} elseif {![string is integer $teams]} {
putserv "NOTICE $nickname :Teams must only consist on numbers."
} elseif {$type != "1on1" && $type != "2on2" && $type != "3on3" && $type != "4on4" && $type != "5on5"} {
putserv "NOTICE $nickname :Invalid cup type '$type'. Valid cup types are: 1on1|2on2|3on3|4on4|5on5."
} elseif {$teams != "8" && $teams != "16" && $teams != "64"} {
putserv "NOTICE $nickname :Invalid teams '$teams'. Valid teams are: 8|16|64."
} else {
channel set $channel +cup
channel set $channel cupadmin $nickname
channel set $channel cuptype $type
channel set $channel cupteams $teams
channel set $channel cupprize ""
if {[botisop $channel] && ![string match *m* [getchanmode $channel]]} {
putserv "MODE $channel +m"
set modem "1"
}
putserv "PRIVMSG $channel :$nickname started a $type cup with $teams teams."
if {$type == "1on1"} {
putserv "PRIVMSG $channel :Use ${cupbot::trigger}add <teamname> to add yourself to the $type cup."
} elseif {$type == "2on2"} {
putserv "PRIVMSG $channel :Use ${cupbot::trigger}add <teamname> <mate> to add your team to the $type cup."
} elseif {$type == "3on3"} {
putserv "PRIVMSG $channel :Use ${cupbot::trigger}add <teamname> <mate> <mate> to add your team to the $type cup."
} elseif {$type == "4on4"} {
putserv "PRIVMSG $channel :Use ${cupbot::trigger}add <teamname> <mate> <mate> <mate> to add your team to the $type cup."
} elseif {$type == "5on5"} {
putserv "PRIVMSG $channel :Use ${cupbot::trigger}add <teamname> <mate> <mate> <mate> <mate> to add your team to the $type cup."
}
if {$map != ""} {
channel set $channel cupmap $map
putserv "PRIVMSG $channel :The map is: $map."
} else {
putserv "PRIVMSG $channel :No map has been set."
}
if {$modem == "1"} {
if {[botisop $channel] && [string match *m* [getchanmode $channel]]} {
putserv "MODE $channel -m"
}
}
}
}
}
proc cupbot::stop {nickname hostname handle channel text} {
if {[channel get $channel cup]} {
channel set $channel -cup
putserv "PRIVMSG $channel :$nickname stopped the [channel get $channel cuptype] cup."
} else {
putserv "NOTICE $nickname :There is currently no cup in progress on $channel."
}
}
proc cupbot::setmap {nickname hostname handle channel text} {
if {![channel get $channel cup]} {
putserv "NOTICE $nickname :There is currently no cup in progress on $channel."
} elseif {$text == ""} {
putserv "NOTICE $nickname :Usage: $::lastbind <map>."
} else {
channel set $channel cupmap $text
putserv "PRIVMSG $channel :$nickname changed the map to: $text."
}
}
proc cupbot::setprize {nickname hostname handle channel text} {
if {![channel get $channel cup]} {
putserv "NOTICE $nickname :There is currently no cup in progress on $channel."
} elseif {$text == ""} {
putserv "NOTICE $nickname :Usage: $::lastbind <prize>."
} else {
channel set $channel cupprize $text
putserv "PRIVMSG $channel :$nickname changed the prize to: $text."
}
}
proc cupbot::setwinner {nickname hostname handle channel text} {
if {![channel get $channel cup]} {
putserv "NOTICE $nickname :There is currently no cup in progress on $channel."
} elseif {$text == ""} {
putserv "NOTICE $nickname :Usage: $::lastbind <winner>."
} else {
channel set $channel cupwinner $text
putserv "PRIVMSG $channel :The cup winner is: $text."
}
}
proc cupbot::map {nickname hostname handle channel text} {
if {![channel get $channel cup]} {
putserv "PRIVMSG $channel :There is currently no cup running."
} else {
if {[channel get $channel cupmap] == ""} {
putserv "PRIVMSG $channel :There is currently no map set."
} else {
putserv "PRIVMSG $channel :The current map is: [channel get $channel cupmap]."
}
}
}
proc cupbot::prize {nickname hostname handle channel text} {
if {![channel get $channel cup]} {
putserv "PRIVMSG $channel :There is currently no cup running."
} else {
if {[channel get $channel cupprize] == ""} {
putserv "PRIVMSG $channel :There is currently no prize set."
} else {
putserv "PRIVMSG $channel :The prize is: [channel get $channel cupprize]."
}
}
}
putlog "Cupbot.tcl v$cupbot::version by $cupbot::author loaded." |
Im currently still working on it, once it is fully finished when i have more spare time, i will release it here. keep posted. _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Tue Jun 20, 2006 6:46 pm Post subject: |
|
|
| Sainted wrote: | | MeTroiD wrote: | | What is a cop module supposed to be? And what do modules have to do with scripts? |
Oops sorry, typo I ment a cup module... But a module is about the same as a script right, or are there major differences? |
As MeTroiD pointed out, modules have nothing to do with scripts and in future please post in the correct forum. _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
Sainted Voice
Joined: 16 Jun 2006 Posts: 3
|
Posted: Mon Jun 26, 2006 8:28 am Post subject: |
|
|
| Alchera wrote: | | Sainted wrote: | | MeTroiD wrote: | | What is a cop module supposed to be? And what do modules have to do with scripts? |
Oops sorry, typo I ment a cup module... But a module is about the same as a script right, or are there major differences? |
As MeTroiD pointed out, modules have nothing to do with scripts and in future please post in the correct forum. |
Well where do you draw the line between a module and a script then.. Seeing every module is built out of scripts too :< |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Mon Jun 26, 2006 4:02 pm Post subject: |
|
|
A module is written in C and is loaded by the eggdrop itself.
Scripts are loaded by TCL. |
|
| Back to top |
|
 |
|