egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

mysql $var

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
garfwen
Halfop


Joined: 12 Mar 2008
Posts: 61

PostPosted: Sat May 30, 2009 5:11 am    Post subject: mysql $var Reply with quote

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
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Sat May 30, 2009 8:14 am    Post subject: Reply with quote

Include $nick in your output line:

Code:
putserv "PRIVMSG $nick :$nick $txt"

_________________
r0t3n @ #r0t3n @ Quakenet
Back to top
View user's profile Send private message MSN Messenger
garfwen
Halfop


Joined: 12 Mar 2008
Posts: 61

PostPosted: Sat May 30, 2009 9:26 am    Post subject: Reply with quote

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 Embarassed
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat May 30, 2009 11:54 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
garfwen
Halfop


Joined: 12 Mar 2008
Posts: 61

PostPosted: Sun May 31, 2009 5:52 am    Post subject: Reply with quote

Thank you
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber