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 make script

Old posts that have not been replied to for several years.
Locked
User avatar
hikaro
Halfop
Posts: 68
Joined: Wed Mar 10, 2004 4:29 am

help me make script

Post by hikaro »

Hi anyone pls have time to make me tcl script please...
i want it like this, when ppls type !score on main the bot will msg the nick all file in score.txt (folder eggdrop). And i want to add like this, the bot master just need /msg botnick !update file file file file . and it will replace all the older file ( means older files deleted ).


anyone please? i really need this script thx
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

You'll find the info you need to read from a file here.
User avatar
hikaro
Halfop
Posts: 68
Joined: Wed Mar 10, 2004 4:29 am

Post by hikaro »

thanks for fast reply,i read it but i still cant get it ;(
i'm newbie here, can someone else script it for me please..
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

I think there was a rule about topic name....
User avatar
hikaro
Halfop
Posts: 68
Joined: Wed Mar 10, 2004 4:29 am

Post by hikaro »

yea i read it and try also but cant, i just dont know how to make it like when i pv it will del the old file and replace with new one...
someone please help me make it, i will really appreciate it.
thanks
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

Check this. I don't really know what you mean with update thingie.
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Your topic name is actually not right, In your topic title it says help you make a script, but your asking us to make you a script, you don't seem to do any effort yourself :p
User avatar
hikaro
Halfop
Posts: 68
Joined: Wed Mar 10, 2004 4:29 am

Post by hikaro »

thx ]kami[...
yea the script i want is like that but i want it auto update when the owner or master of the bot msg the bot like (/msg botnick !update file file file) the bot will replace the old file in .txt with the new one... thats where i stuck....
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

post the code you got so far, and maybe we can tell what's wrong with it.
User avatar
hikaro
Halfop
Posts: 68
Joined: Wed Mar 10, 2004 4:29 am

Post by hikaro »

Code: Select all

bind pub -|- "!score" pub:score
bind msg m "!update" msg:update

proc pub:score {nick host hand chan arg} { 
set fname [open score.txt r] 
while {![eof $fname]} { 
set scored [gets $fname] 
putquick "PRIVMSG $chan :$scored" 
} 
close $fname 
}

proc msg:update {nick host hand chan arg} { 

i just can do like that, i dont know how to make it auto replace from old file to new file... anyone please?[/quote]
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

bind msg m update p
proc p {n u h t} {
  set t [split $t]
  set old [lindex $t 0]
  set new [lindex $t 1]
  exec mv $new $old
}
User avatar
hikaro
Halfop
Posts: 68
Joined: Wed Mar 10, 2004 4:29 am

Post by hikaro »

demon thx for your reply, but it doesnt work.... :(
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

hikaro wrote:demon thx for your reply, but it doesnt work.... :(
then specify the exact format of update command, or tweak this to work yourself
Locked