| View previous topic :: View next topic |
| Author |
Message |
skywalker Voice
Joined: 07 Jan 2012 Posts: 5
|
Posted: Sun Jan 08, 2012 4:03 pm Post subject: need help with split the realname |
|
|
i use my realname field to fill in the a/s/l
now i want to strip that into 3 seperate things.
and be displayed like belowe
i need help with the what to write here sections in the script
| Code: |
bind join - * whoisjoin
bind raw * 311 realname
# nicks to be exempted from asl
set aslexclude_nicks ""
proc whoisjoin {nick uhost hand chan} {
global aslexclude_nicks botnick
if {$nick==$botnick} { return }
if {[string match "*$nick;*" $aslexclude_nicks]} { return }
set ::jchan $chan
putquick "whois $nick"
}
proc realname {from key arg} {
global botnick nick
set argst [clone_stripcodes [string trim $arg]]
putlog "arg is $arg"
set cchan $::jchan
set realname [string range $argst [expr [string first : $argst] +1] end]
set age WHAT TO WRITE HERE
set sex WHAT TO WRITE HERE
set location WHAT TO WRITE HERE
putlog "$nick is a $age years old $sex from $location"
} |
|
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Mon Jan 09, 2012 8:53 am Post subject: |
|
|
Just split your realname on the "/" character, you'll have an usable list.
| Code: | proc realname {from key arg} {
global botnick nick
set argst [clone_stripcodes [string trim $arg]]
putlog "arg is $arg"
set cchan $::jchan
set realname [split [string range $argst [expr [string first : $argst] +1] end] "/"]
set age [lindex $realname 0]
set sex [lindex $realname 1]
set location [join [lrange $realname 2 end]]
putlog "$nick is a $age years old $sex from $location"
} |
_________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
skywalker Voice
Joined: 07 Jan 2012 Posts: 5
|
Posted: Mon Jan 09, 2012 1:08 pm Post subject: |
|
|
| thx mate |
|
| Back to top |
|
 |
|