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.

Match Finder Script

Old posts that have not been replied to for several years.
Locked
M
Maptec
Voice
Posts: 3
Joined: Sat Jan 29, 2005 12:31 am

Match Finder Script

Post by Maptec »

What i am needing (and yes i have tried to make myself with no luck) is a Match Finder script.

Basicly the first team will add to the script with !addteam <team name> <server> the secong team will come and !addteam <teamname> then the bot would announce in the channel "Team1 V Team2 on Team1 Server.

it has a public command of !match to show currently added teams and a timer that can be set to clear the team after so many minutes if there isn`t a second team that has added.

Is this possible or and i just not that good with tcl
M
Maptec
Voice
Posts: 3
Joined: Sat Jan 29, 2005 12:31 am

Post by Maptec »

lol guess no one can help me?
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

"can" has a varios set of meanings, I'm sure many could help you... but the script you have requested will be more than just 10 lines of code so... maybe you should give it a try yourself. you will need a pubm bind, look for general and eggdrop specific tcl help to learn about tables so you can save the teams there and how to search a string again within it.
If it doesnt work, there will be sure someone helping you debugging it.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
M
Maptec
Voice
Posts: 3
Joined: Sat Jan 29, 2005 12:31 am

Post by Maptec »

ty :) If I didn`t delete it out of frustration i will post what i did have and see if it can work
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Something like this, not the exact thing, but very similar to what you want. There might be a bug or two in it, because it was written in less than 5 minutes, so give it a run and debug.

Code: Select all

bind pub - "!addteam1" add:team1
bind pub - "!addteam2" add:team2
bind pub - "!match" teams:match

proc add:team1 {nick uhost hand chan text} {
 global team1name team1server
  set team1name [lindex $text 0]
  set team1server [lindex $text 1]
}

proc add:team2 {nick uhost hand chan text} {
 global team1name team1server team2name team2server
  if {[info exists team1name] && [info exists team1server]} {
  set team2name [lindex $text 0]; set team2server [lindex $text 1]
  putserv "PRIVMSG $chan :$team1name vs $team2name on $team1server"
 }
 putserv "PRIVMSG $chan :Cannot add Team #2. There is no Team #1 currently added."
}

proc teams:match {nick uhost hand chan text} {
 global team1name team1server team2name team2server
 if {![info exists team2name] && ![info exists team2server]} {
  putserv "PRIVMSG $chan :There cannot be a match. Team #2 has not been added."
 }
 if {[string equal -nocase "clear" [lindex $text 0]]} { 
 unset team1name; unset team1server
 unset team2name; unset team2server
 }
 if {[lindex $text 0] == ""} {
 putserv "PRIVMSG $chan: Listing currently added teams:
 putserv "PRIVMSG $chan: Team #1: $team1name on $team1server
 putserv "PRIVMSG $chan: Team #2: $team2name on $team2server
 }
}
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked