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.

A script that sets the info

Old posts that have not been replied to for several years.
Locked
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

A script that sets the info

Post by metroid »

Hey, I've been looking for a script that sets the info for you with
/msg <bot> info <your infoline>

Or if you have userinfo.tcl i believe you can use .info <infoline>

But i need a msg version of that but i havent been able to find one and i have no clue how to make a script that does it myself :(

So if someone knows a script like this or has one, Plz post :)
n
netux
Voice
Posts: 19
Joined: Fri Jul 30, 2004 8:42 pm

Post by netux »

from userinfo.tcl
# TYPE COMMAND USAGE
# ====== ============== ========================================
# msg <info> To change your <info> via /MSG.
# dcc .<info> To change your <info> via DCC.
# dcc .ch<info> To change someone else's <info> via DCC.
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Right there is my problem. 1 of my scripts unbinds all the default msg binds thus, my /msg <info> bind.

Thats why i need a seperate script for it :(
User avatar
K
Voice
Posts: 34
Joined: Wed Jan 28, 2004 7:31 pm
Location: Romania @sibiu
Contact:

than

Post by K »

than on that script remove that line :o
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

And than half of the scripts funtionality is gone? :\
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

why don't you just load userinfo after running the script that unbinds?
Have you ever read "The Manual"?
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

the thing is, I have a piece of code that loads every script in the script folder and if there is an error, it will make a log of it, and if im not mistaken, userinfo IS loaded after the script that wipes all other binds, but userinfo doesnt bind the msg i believe, I think its build into eggdrop.

Code: Select all

foreach script [glob scripts/*] {
  if {(![file isdirectory $script]) && ([regexp {^(.+)\.tcl$} $script])} {
    catch {source $script} error
    if {$error != ""} {
      putlog "ERROR: the following error occured while evaluating ${script}: $error"
    }
  }
}
If you remove all other "source scripts/*script.tcl*" lines from ur eggdrop.conf this will load all the scripts and if it finds an error ( such as a missing close brace ) it will make a log of it and the bot won't crash :)

Here is the piece of code that deletes all the bind msgs

Code: Select all

foreach bind [binds msg] {
  regexp -- {(.+)\s(.+)\s(.+)\s.+\s(.+)} $bind tmp type flags command name
  regsub -all -- {([^\*]+)} $name {} result
  if {$result == "*"} {
    catch {unbind $type $flags $command $name}
  }
}
This unbinds all the msg binds thus i need a script that rebinds the userinfo
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

add

Code: Select all

bind msg - info *msg:info
after the unbind thing

I took the liberty of rewriting those two loops of yours...

Code: Select all

foreach script [glob -nocomplain -types f -dir scripts *.tcl] {
	if {[catch {source $script} re]} {
		putlog "ERROR: the following error occured while evaluating $script: $error"
	}
}
foreach bind [binds \\*msg:*] {
	catch "unbind [lreplace $bind 3 3]"
}
Have you ever read "The Manual"?
Locked