| View previous topic :: View next topic |
| Author |
Message |
Felix2003 Voice
Joined: 06 Feb 2009 Posts: 24
|
Posted: Fri Feb 06, 2009 8:38 pm Post subject: On JOin Link |
|
|
Hello all i was wondering if somebody could assist me i have just started learning TCL scripts and find it really confusing lol anyway to my request i used to do mirc scripts and have a script that when i used joined #help it would display a link to there profile in another room along with a few other information for example
<UserBot> User has joined #help as <Felix2003> <Felix2003@Felix.The.Crazy.Cat>
<UserBot> User Details For Felix2003 ----> http://www.sitename.com/users.php?search=Felix2003
now i can get the 2nd part the link to the site to work but the 1st seems abit harder
now the 2nd part
we also have a java client that users can use but it puts a annoying _ at the end of there name when the link shows in the other room id like the _ to be removed from the link so for example
<UserBot> User has joined #help as <Felix2003> <Felix2003@Felix.The.Crazy.Cat>
<UserBot> User Details For Felix2003_ ----> http://www.sitename.com/users.php?search=Felix2003_
would show with the _ removed
<UserBot> User has joined #help as <Felix2003> <Felix2003@Felix.The.Crazy.Cat>
<UserBot> User Details For Felix2003_ ----> http://www.sitename.com/users.php?search=Felix2003
also i would like but not important a exception list so the staff when they enter or ping and rejoin doesn't activate it
i hope somebody could help
thank you for your time |
|
| Back to top |
|
 |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Sat Feb 07, 2009 4:35 am Post subject: |
|
|
| I think that _ can be stopped if you use $uhost instead of $nick |
|
| Back to top |
|
 |
Felix2003 Voice
Joined: 06 Feb 2009 Posts: 24
|
Posted: Sat Feb 07, 2009 5:57 am Post subject: |
|
|
| ok you just solved the 1st part thank you xD but it doesn't remove the _ |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sat Feb 07, 2009 10:27 am Post subject: |
|
|
Everything in this thread is covered in many others as well, searching before posting questions can give you answers much faster than waiting for a reply...
| Code: | | putserv "privmsg $relaychan :User Details For $nick ----> http://www.sitename.com/users.php?search=[string map {"_" ""} $nick]" |
_________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
Felix2003 Voice
Joined: 06 Feb 2009 Posts: 24
|
Posted: Sat Feb 07, 2009 10:47 am Post subject: |
|
|
ty speechless i did search but couldnt find anything i bet i passed it lol  |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Feb 07, 2009 3:16 pm Post subject: |
|
|
The disadvantage of string map is that it will remove any _ within the nick, not only trailing ones (messing up nicknames such as my own, NML_375).
I would rather recommend using the string trimright command;
| Code: | | puthelp "PRIVMSG $relaychan :User Details For $nick ----> http://www.sitename.com/users.php?search=[string trimright $nick "_"]" |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Felix2003 Voice
Joined: 06 Feb 2009 Posts: 24
|
Posted: Sat Feb 07, 2009 7:01 pm Post subject: |
|
|
nml375 your worked perfectly i wasnt thinking of if the had the _ in there name other then at the end thank you
also was wonderingif anybody managed to find away for a exceptions list? |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Feb 07, 2009 7:06 pm Post subject: |
|
|
For that, I would recommend some kind of timestamping mechanism.
Something like this should do the trick (based on code posted by user):
| Code: | proc throttle {id time} {
if {[info exists ::throttle($id)] && $::throttle($id) > [clock seconds]} {
return 0
}
set ::throttle($id) [expr [clock seconds] + $time]
return 1
}
proc myproc {} {
if {[throttle "theid" 300]} {
#we're ok, do the good stuff here
} {
#still throttle'd, do nothing
return 0
}
} |
Edit: A good idea for id would be nickname of the joiner, nick:chan, or something like that. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|