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.

On JOin Link

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
F
Felix2003
Voice
Posts: 24
Joined: Fri Feb 06, 2009 8:19 pm

On JOin Link

Post by Felix2003 »

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
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

I think that _ can be stopped if you use $uhost instead of $nick
F
Felix2003
Voice
Posts: 24
Joined: Fri Feb 06, 2009 8:19 pm

Post by Felix2003 »

ok you just solved the 1st part thank you xD but it doesn't remove the _
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

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... :wink:

Code: Select all

putserv "privmsg $relaychan :User Details For $nick ----> http://www.sitename.com/users.php?search=[string map {"_" ""} $nick]"
F
Felix2003
Voice
Posts: 24
Joined: Fri Feb 06, 2009 8:19 pm

Post by Felix2003 »

ty speechless i did search but couldnt find anything i bet i passed it lol :)
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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: Select all

puthelp "PRIVMSG $relaychan :User Details For $nick ----> http://www.sitename.com/users.php?search=[string trimright $nick "_"]"
NML_375
F
Felix2003
Voice
Posts: 24
Joined: Fri Feb 06, 2009 8:19 pm

Post by Felix2003 »

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?
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

For that, I would recommend some kind of timestamping mechanism.
Something like this should do the trick (based on code posted by user):

Code: Select all

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
Post Reply