| View previous topic :: View next topic |
| Author |
Message |
garfwen Halfop
Joined: 12 Mar 2008 Posts: 61
|
Posted: Sat May 30, 2009 5:11 am Post subject: mysql $var |
|
|
Hello
<Dude> getmsg
<Bot> Yeah its working
| Code: |
bind msg - getmsg getmsg
proc getmsg { nick host handle text } {
global db
set txt [lindex [lindex [::mysql::sel $db "SELECT language FROM lang WHERE cmd='works'" -list] 0] 0]
putserv "privmsg $nick :$txt"
}
|
In this case txt will return "Yeah its working".
Is it possible to put a var like $nick on my mysql? so it can return "Dude Yeah its working"
<Dude> getmsg
<Bot> Dude Yeah its working
(sorry for my bad english)
GaRfWeN |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Sat May 30, 2009 8:14 am Post subject: |
|
|
Include $nick in your output line:
| Code: | | putserv "PRIVMSG $nick :$nick $txt" |
_________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
garfwen Halfop
Joined: 12 Mar 2008 Posts: 61
|
Posted: Sat May 30, 2009 9:26 am Post subject: |
|
|
Thats not what i mean...
$nick var should be on mysql like
mysql output: "%nick talked with me (%host)"
Eggdrop selects that from DB and sendes "%nick talked with me (%host)"
i want it to send "Dude talked with me (Super!Dude@host.com)"
------------
Confusing  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat May 30, 2009 11:54 am Post subject: |
|
|
| Code: | | set txt [string map [list %nick $nick %host $host] [join $txt]] |
this will replace %nick and %host with the user's nickname and user@host respectively. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
garfwen Halfop
Joined: 12 Mar 2008 Posts: 61
|
Posted: Sun May 31, 2009 5:52 am Post subject: |
|
|
| Thank you |
|
| Back to top |
|
 |
|