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

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

help

Post by abah »

Code: Select all

bind pub * !story join:story 
bind pub o|o !stop stop:story

proc join:story {nick uhost hand chan rest} { 
  global story_timers 
  set story "/home/s/sapri/mujahid/isi/db/isi.db" 
  if {![info exists story_timers($story)]} { 
    slowmsg $story 
    } else { 
    puthelp "privmsg $nick :Mohon tunggu sedang membaca files..." 
  } 
}

proc stop:story {nick uhost hand chan arg} { 
   global story_timers 
   if {[info exists story_timers]} { 
     killtimer story_timers* 
    } else {
    puthelp "privmsg $nick :Terima kasih sudah membaca cerita ane..."
	}
}
 
proc slowmsg {file {pos 0}} { 
  global story_timers 
  set f [open $file] 
  seek $f $pos 
  if {[gets $f line]>-1} { 
    putserv "privmsg #Tausiyah :12 $line" 
    set story_timers($file) [utimer 11 [list slowmsg $file [tell $f]]] 
    } else { 
    utimer 15 [list putserv "Membaca kembali files:"] 
    set story_timers($file) [utimer 16 [list slowmsg $file]] 
  } 
  close $f 
}
hello can anyone help me? I have tried all the scripts on this forum but they all don't work. Please me, what about the scripts if I want to stop when I type! Story. Thank you in advance
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

You want to use !story to start and stop the script?
Last edited by ComputerTech on Thu Dec 24, 2020 6:32 pm, edited 4 times in total.
ComputerTech
User avatar
abah
Halfop
Posts: 62
Joined: Sun Dec 01, 2013 3:04 am
Location: Indonesia

Post by abah »

ComputerTech wrote:1st. you want to use !story to stop the script?
when I type !story script works as it should. When I type !stop the script will stop
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

Ok, so you want !story to start the script and !stop to stop the script, correct?

If so, and !stop isn't currently working for you.

Try changing

Code: Select all

bind pub o|o !stop stop:story
To

Code: Select all

bind pub * !stop stop:story
TIP, when changing Binds, you Should Restart your bot, and not just a standard Rehash :wink:
ComputerTech
Post Reply