This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

So what's up with all the cup modules?

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
S
Sainted
Voice
Posts: 3
Joined: Fri Jun 16, 2006 4:00 am

So what's up with all the cup modules?

Post by Sainted »

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.
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

What is a cop module supposed to be? And what do modules have to do with scripts?
S
Sainted
Voice
Posts: 3
Joined: Fri Jun 16, 2006 4:00 am

Post by Sainted »

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?
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

Well.. I have started to make a cupbot script, this is what i have so far..

Code: Select all

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
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

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
S
Sainted
Voice
Posts: 3
Joined: Fri Jun 16, 2006 4:00 am

Post by Sainted »

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 :<
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

A module is written in C and is loaded by the eggdrop itself.

Scripts are loaded by TCL.
Post Reply