egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

omgword script does not work correct

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Fraud
Op


Joined: 19 May 2008
Posts: 101

PostPosted: Fri Jan 23, 2009 7:43 am    Post subject: omgword script does not work correct Reply with quote

Hello everybody. I have a quit old omgword script which is bit buggy.
If somebody solves a word the first time, the script counts doubled.

thats what it does only the first time. Output is in german

Quote:
Bot-Output - OMG-Word: Füller wurde von Rashors richtig erraten. Rashors hat 1 Punkte
Bot-Output - OMG-Word: Füller wurde von Rashors richtig erraten. Rashors hat 2 Punkte

here is the error
Tcl error [omgfertig]: invalid timerID

and thats the script
Code:
#############
### Binds ###
#############

bind PUB -|- .omg omgword


set count "0"
set omgwoerter "scripts/priv/db/omg.txt"

#################
### FloodProt ###
#################

proc noflood { type channel } {
if {[string equal -nocase "check" $type]} {
if {[info exists ::noflood($channel)] && [expr [unixtime] - $::noflood($channel)] < 30} {
return 1
}
return 0
} elseif {[string equal -nocase "set" $type]} {
set ::noflood($channel) [unixtime]
}
}

#############
### Procs ###
#############

####################
### UmdrehenProc ###
####################

proc umdrehen { wort } {
set wort2 "[string toupper [lindex [split $wort ""] 0]][join [lrange [split $wort ""] 1 end] ""]"
set n $wort2
while { $wort2 == $n } {
set n ""
foreach b [split $wort2 ""] { if { [rand 2] != "1" } { set n "$n$b" } { set n "$b$n" } }
}
return $n
}

############
### Main ###
############

proc omgword { nick host hand chan args } {
global count
if {[noflood check $chan]} {
putquick "NOTICE $nick : Mit flooden kannst du nix bezwingen!"
return
}
set ::norm(wort) [lindex [set fileList [split [read [set fs [open "$::omgwoerter" r]]] \n]] [rand [llength $fileList]]][close $fs]
set count [expr $count + 1]
putquick "PRIVMSG $chan :\002OMG-Word\002: nr: \002$count\002 Okay dann fangt mal an zu raten, wir suchen: \037[umdrehen $::norm(wort)]\037, ihr habt 30s Zeit."
bind pubm - "$chan $::norm(wort)" omgfertig
set ::timer [utimer 30 [list putquick "PRIVMSG $chan :\002OMG-Word\002: nr: \002$count\002 Leider hat keiner das Wort erraten, wir haben \037$::norm(wort)\037 gesucht."]]
set ::timermoney [utimer 29 [list unbind pubm - "$chan $::norm(wort)" omgfertig]]

noflood set $chan
}

##################
### OMG-Fertig ###
##################

proc omgfertig {nick host hand chan arg} {
global counter
if {![info exists counter($nick)]} {
set counter($nick) 1
putquick "PRIVMSG $chan : \002OMG-Word\002: \037$::norm(wort)\037 wurde von \002$nick\002 richtig erraten. $nick hat $counter($nick) Punkte"
killutimer $::timer
killutimer $::timermoney
unbind pubm - "$chan $::norm(wort)" omgfertig
}
if {[info exists counter($nick)]} {
set counter($nick) [expr $counter($nick) +1]
global counter($nick)
putquick "PRIVMSG $chan : \002OMG-Word\002: \037$::norm(wort)\037 wurde von \002$nick\002 richtig erraten. $nick hat $counter($nick) Punkte"
killutimer $::timer
killutimer $::timermoney
unbind pubm - "$chan $::norm(wort)" omgfertig
}
}
[/code]

So. hopefully you can help me. thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber