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.

help me please

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
w
whiteshark
Halfop
Posts: 62
Joined: Sun Jun 12, 2005 3:23 am
Location: netherlands
Contact:

help me please

Post by whiteshark »

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: Select all

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

Post by r0t3n »

this sounds more like a idle bot and not a funbot.
r0t3n @ #r0t3n @ Quakenet
w
whiteshark
Halfop
Posts: 62
Joined: Sun Jun 12, 2005 3:23 am
Location: netherlands
Contact:

Post by whiteshark »

yes this is a funbot with a idle script and more fun scripts like bomb and fok
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Change

Code: Select all

if {[string first # [set c [lindex [split $arg] 0]]] == 0} {
 channel add $c
 timer 1 [list check:idle $nick $::yourchan $c]
}
to

Code: Select all

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]
 }
}
w
whiteshark
Halfop
Posts: 62
Joined: Sun Jun 12, 2005 3:23 am
Location: netherlands
Contact:

Post by whiteshark »

Thnx :lol: :lol:

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

Post by r0t3n »

Code: Select all

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
w
whiteshark
Halfop
Posts: 62
Joined: Sun Jun 12, 2005 3:23 am
Location: netherlands
Contact:

Post by whiteshark »

Tosser^^
Thnx man :P :P
w
whiteshark
Halfop
Posts: 62
Joined: Sun Jun 12, 2005 3:23 am
Location: netherlands
Contact:

Post by whiteshark »

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 #.

????
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

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]
 }
}
w
whiteshark
Halfop
Posts: 62
Joined: Sun Jun 12, 2005 3:23 am
Location: netherlands
Contact:

Post by whiteshark »

sorry not working when i typ !idle #qstat

Code: Select all

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] 
}
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

That code will not work ofcourse, use:

Code: Select all

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 :P
Last edited by Sir_Fz on Thu Apr 06, 2006 5:46 pm, edited 3 times in total.
w
whiteshark
Halfop
Posts: 62
Joined: Sun Jun 12, 2005 3:23 am
Location: netherlands
Contact:

Post by whiteshark »

oke sorry but THNX
w
whiteshark
Halfop
Posts: 62
Joined: Sun Jun 12, 2005 3:23 am
Location: netherlands
Contact:

Post by whiteshark »

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
????
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

You probably used a lame editor when pasting the code, try pico instead.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

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
Post Reply