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.

please help

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
abah
Halfop
Posts: 92
Joined: Sun Dec 01, 2013 3:04 am
Location: Indonesia

please help

Post by abah »

I would like to ask a little help for the script because I do not know how to make it stop when! start can not be made script stopkan please !stop thanks

Code: Select all

bind pub * !story join:story 
proc join:story {nick uhost hand chan rest} { 
  global story_timers 
  set story "cerita/ukhuwah.txt" 
  if {![info exists story_timers($story)]} { 
    slowmsg $story 
  } else { 
    puthelp "privmsg $nick :already reading..." 
  } 
} 
proc slowmsg {file {pos 0}} { 
  global story_timers 
  set f [open $file] 
  seek $f $pos 
  if {[gets $f line]>-1} { 
    putserv "privmsg #Ukhuwah :$line" 
    set story_timers($file) [utimer 11 [list slowmsg $file [tell $f]]] 
  } else { 
    utimer 15 [list putserv "Re-reading the story:"] 
    set story_timers($file) [utimer 16 [list slowmsg $file]] 
  } 
  close $f 
}
User avatar
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Post by Get_A_Fix »

In this case it would be pretty easy, you'd just have to add a killtimer to a !stop command.

Code: Select all

bind pub o|o !stop stop:story
proc stop:story {nick uhost hand chan arg} {
  global story_timers
  if {[info exists story_timers]} {
    killtimer story_timers*
  }
}
Or something to that effect.

This binds using o|o (globalop|chanop) - reducing the use to everyone, thus minimising on unwanted flood attempts.
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.
User avatar
abah
Halfop
Posts: 92
Joined: Sun Dec 01, 2013 3:04 am
Location: Indonesia

Post by abah »

thank for response i try

Edit: thanks for the help and the response will be, but I've tried and it did not work if there is another search?
Post Reply