| View previous topic :: View next topic |
| Author |
Message |
whiteshark Halfop
Joined: 12 Jun 2005 Posts: 62 Location: netherlands
|
Posted: Sun Apr 02, 2006 4:39 pm Post subject: help me please |
|
|
hello i have a funbot
When somebody typ this in the chan !idle #chan the bot goes to the channel.
But the bot must say if someone twice asked !idle #chan sorry i Error: I'm already there!
and when de bot is on 20 chan he must say this Error: I'm on 20/20 chans - Please try again later!
thnx
this is a script that i have founded .
Thnx
| Code: | set yourchan "#chan1"
bind pub - !idle idle:chan
proc idle:chan {nick uhost hand chan arg} {
if {![string equal -nocase $::yourchan $chan]} { return 0 }
if {[string first # [set c [lindex [split $arg] 0]]] == 0} {
channel add $c
timer 1 [list check:idle $nick $::yourchan $c]
}
}
proc check:idle {n yc c} {
if {![onchan $n $yc]} {
if {[validchan $c]} {
channel remove $c
}
return 0
}
timer 1 [list check:idle $n $yc $c]
} |
|
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Sun Apr 02, 2006 5:10 pm Post subject: |
|
|
this sounds more like a idle bot and not a funbot. _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
whiteshark Halfop
Joined: 12 Jun 2005 Posts: 62 Location: netherlands
|
Posted: Sun Apr 02, 2006 5:27 pm Post subject: |
|
|
| yes this is a funbot with a idle script and more fun scripts like bomb and fok |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Apr 02, 2006 6:50 pm Post subject: |
|
|
Change
| Code: | if {[string first # [set c [lindex [split $arg] 0]]] == 0} {
channel add $c
timer 1 [list check:idle $nick $::yourchan $c]
} |
to
| Code: | if {[string first # [set c [lindex [split $arg] 0]]] == 0} {
if {[validchan $c]}} {
puthelp "privmsg $chan :Error: I'm already there!"
} {
channel add $c
timer 1 [list check:idle $nick $::yourchan $c]
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
whiteshark Halfop
Joined: 12 Jun 2005 Posts: 62 Location: netherlands
|
Posted: Mon Apr 03, 2006 12:20 pm Post subject: |
|
|
Thnx
But one more question
can you make it .
and when de bot is on 20 chan he must say this Error: I'm on 20/20 chans - Please try again later! |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Mon Apr 03, 2006 12:38 pm Post subject: |
|
|
| Code: | set yourchan "#chan"
bind pub - !idle idle:chan
proc idle:chan {nickname hostname handle channel text} {
if {![string match -nocase "$::yourchan" "$channel"]} { return }
set chan [lindex [split $text] 0]
if {$chan == ""} {
putserv "NOTICE $nickname :Usage: $::lastbind #channel."
} elseif {[string first # $chan] == "0"} {
putserv "NOTICE $nickname :Error: Channel name must start with #."
} elseif {[validchan $chan]} {
putserv "NOTICE $nickname :Error: Im already on $chan."
} elseif {[llength [channels]] >= 20} {
putserv "NOTICE $nickname :Error: Im on 20/20 chans."
} else {
channel add $chan
utimer 60 [list check:idle $nick $::yourchan $chan]
}
} |
_________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
whiteshark Halfop
Joined: 12 Jun 2005 Posts: 62 Location: netherlands
|
Posted: Mon Apr 03, 2006 12:44 pm Post subject: |
|
|
Tosser^^
Thnx man  |
|
| Back to top |
|
 |
whiteshark Halfop
Joined: 12 Jun 2005 Posts: 62 Location: netherlands
|
Posted: Mon Apr 03, 2006 12:52 pm Post subject: |
|
|
when i typ !idle #qstat
bot gives everey time this
^Fun-Bot^ Error: Channel name must start with #.
i typ !idle #trivia.nl the same answer
^Fun-Bot^ Error: Channel name must start with #.
???? |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Apr 03, 2006 12:57 pm Post subject: |
|
|
| Code: | if {[string first # [set c [lindex [split $arg] 0]]] == 0} {
if {[llength [channels]] >= 20} {
puthelp "privmsg $chan :Error: I'm on 20/20 chans."
} elseif {[validchan $c]} {
puthelp "privmsg $chan :Error: I'm already there!"
} {
channel add $c
timer 1 [list check:idle $nick $::yourchan $c]
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
whiteshark Halfop
Joined: 12 Jun 2005 Posts: 62 Location: netherlands
|
Posted: Mon Apr 03, 2006 1:06 pm Post subject: |
|
|
sorry not working when i typ !idle #qstat
| Code: | set yourchan "#trivia.nl"
bind pub - !idle idle:chan
proc idle:chan {nick uhost hand chan arg} {
if {![string equal -nocase $::yourchan $chan]} { return 0 }
if {[string first # [set c [lindex [split $arg] 0]]] == 0} {
if {[llength [channels]] >= 20} {
puthelp "privmsg $chan :Error: I'm on 20/20 chans."
} elseif {[validchan $c]}} {
puthelp "privmsg $chan :Error: I'm already there!"
} {
channel add $c
timer 1 [list check:idle $nick $::yourchan $c]
}
}
proc check:idle {n yc c} {
if {![onchan $n $yc]} {
if {[validchan $c]} {
channel remove $c
}
return 0
}
timer 1 [list check:idle $n $yc $c]
}
|
|
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Apr 03, 2006 2:37 pm Post subject: |
|
|
That code will not work ofcourse, use:
| Code: | set yourchan "#trivia.nl"
bind pub - !idle idle:chan
proc idle:chan {nick uhost hand chan arg} {
if {![string equal -nocase $::yourchan $chan]} { return 0 }
if {[string first # [set c [lindex [split $arg] 0]]] == 0} {
if {[llength [channels]] >= 20} {
puthelp "privmsg $chan :Error: I'm on 20/20 chans."
} elseif {[validchan $c]} {
puthelp "privmsg $chan :Error: I'm already there!"
} {
channel add $c
timer 1 [list check:idle $nick $::yourchan $c]
}
}
}
proc check:idle {n yc c} {
if {![onchan $n $yc]} {
if {[validchan $c]} {
channel remove $c
}
return 0
}
timer 1 [list check:idle $n $yc $c]
} |
Next time, check your braces' balance.
Edit: Removed extra brace, ironically it was nearly the same mistake from the previous post  _________________ Follow me on GitHub
- Opposing
Public Tcl scripts
Last edited by Sir_Fz on Thu Apr 06, 2006 5:46 pm; edited 3 times in total |
|
| Back to top |
|
 |
whiteshark Halfop
Joined: 12 Jun 2005 Posts: 62 Location: netherlands
|
Posted: Mon Apr 03, 2006 2:42 pm Post subject: |
|
|
| oke sorry but THNX |
|
| Back to top |
|
 |
whiteshark Halfop
Joined: 12 Jun 2005 Posts: 62 Location: netherlands
|
Posted: Mon Apr 03, 2006 3:19 pm Post subject: |
|
|
sorry Sir_Fz
but i have this error
(file "scripts/idlechan.tcl" line 17)
invoked from within
"source scripts/idlechan.tcl"
scripts/idlechan.tcl: ASCII text, with CRLF line terminators
line: cannot open (line)
17: cannot open (17)
its the script something its wrong
???? |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Apr 03, 2006 5:39 pm Post subject: |
|
|
You probably used a lame editor when pasting the code, try pico instead. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Tue Apr 04, 2006 9:08 pm Post subject: |
|
|
| amstelbier wrote: | sorry Sir_Fz
but i have this error
(file "scripts/idlechan.tcl" line 17)
invoked from within
"source scripts/idlechan.tcl"
scripts/idlechan.tcl: ASCII text, with CRLF line terminators
line: cannot open (line)
17: cannot open (17)
its the script something its wrong
???? |
You cannot use Word/Wordpad to edit Unix format files but you may use Notepad as it does not insert non-standard characters with carriage returns. _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
|