<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/16613" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2009-02-12T15:32:25-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/16613</id>

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-02-12T15:32:25-04:00</updated>

		<published>2009-02-12T15:32:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87379#p87379</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87379#p87379"/>
		<title type="html"><![CDATA[Help with joinmsg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87379#p87379"><![CDATA[
If you simply want someone to "fix" the script for you, I would recommend that you try the "Script Request" category instead.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu Feb 12, 2009 3:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Fire-Fox]]></name></author>
		<updated>2009-02-12T15:14:27-04:00</updated>

		<published>2009-02-12T15:14:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87376#p87376</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87376#p87376"/>
		<title type="html"><![CDATA[Help with joinmsg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87376#p87376"><![CDATA[
<blockquote class="uncited"><div>Roger that.<br>The following code will create new records in both joinmsgnicks and joinmsgircuser, based on the previous mentioned assumption:<div class="codebox"><p>Code: </p><pre><code>set query1 [mysqlquery "INSERT INTO joinmsgircuser (username, class) VALUES ("[mysqlescape $username]", [mysqlescape $class])"]set query2 [mysqlquery "INSERT INTO joinmsgnicks (nick, userid) VALUES ("[mysqlescape $nickname]", [mysqlinsertid $db_handle])"]mysqlendquery $query1mysqlendquery $query2</code></pre></div>This would then be placed in some proc, triggered with the binding of your liking. Data should be made available in the variables <em class="text-italics">username</em>, <em class="text-italics">class</em>, and <em class="text-italics">nickname</em>.</div></blockquote>Thanks. but why should i remove from the script (it not used to a site anymore. only when users join my irc channel <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">)<br><br>Could i get you to add it into the script i pasted?<br><br>And then add a tcl command so i just need to type !addmsg (or something) Nickname (and some text)<br><br>So it would look like : "Welcome ::: NickName ::: Some text here<br><br>Self retrived from the database.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8230">Fire-Fox</a> — Thu Feb 12, 2009 3:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-02-12T15:09:42-04:00</updated>

		<published>2009-02-12T15:09:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87375#p87375</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87375#p87375"/>
		<title type="html"><![CDATA[Help with joinmsg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87375#p87375"><![CDATA[
Roger that.<br>The following code will create new records in both joinmsgnicks and joinmsgircuser, based on the previous mentioned assumption:<div class="codebox"><p>Code: </p><pre><code>set query1 [mysqlquery "INSERT INTO joinmsgircuser (username, class) VALUES (\"[mysqlescape $username]\", [mysqlescape $class])"]set query2 [mysqlquery "INSERT INTO joinmsgnicks (nick, userid) VALUES (\"[mysqlescape $nickname]\", [mysqlinsertid $db_handle])"]mysqlendquery $query1mysqlendquery $query2</code></pre></div>This would then be placed in some proc, triggered with the binding of your liking. Data should be made available in the variables <em class="text-italics">username</em>, <em class="text-italics">class</em>, and <em class="text-italics">nickname</em>.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu Feb 12, 2009 3:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Fire-Fox]]></name></author>
		<updated>2009-02-12T14:03:51-04:00</updated>

		<published>2009-02-12T14:03:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87373#p87373</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87373#p87373"/>
		<title type="html"><![CDATA[Help with joinmsg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87373#p87373"><![CDATA[
<blockquote class="uncited"><div>I was hoping for a slight explanation of the fields and any relationship.. but here it goes...<br><br>Generic syntax for inserts:<div class="codebox"><p>Code: </p><pre><code>INSERT INTO table (field1, field2) VALUES (data1, data2)</code></pre></div>In this case, you've got two auto_increment-fields, so you should not set these. This leaves us with "username", "class" for the joinmsgircuser table, and "nick", "userid" for the joinmsgnicks table.<br><br>The code you've posted suggests joinmsgnicks.userid links with joinmsgircuser.id, but you'll have to confirm this...<br><br>In order to retrieve the last_insertid, use the <strong class="text-strong">mysqlinsertid</strong> command.<br><br>Btw, I am a bit puzzled as to why you repeat the same query.</div></blockquote>Hey <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><br><blockquote class="uncited"><div>Btw, I am a bit puzzled as to why you repeat the same query.</div></blockquote>A mate of mine made it a while back. it was made like this:<br><br>If a user signed up on a site, and when the same user joined irc they got a greeting message, something like : Welcome ::: Nick ::: UserClass (On the site)<br><br>And yes then the script don't need the second script i believe?<br><br>but could you help me make it right? im not that good to anything  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cry.gif" width="15" height="15" alt=":cry:" title="Crying or Very sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8230">Fire-Fox</a> — Thu Feb 12, 2009 2:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-02-12T11:41:20-04:00</updated>

		<published>2009-02-12T11:41:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87367#p87367</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87367#p87367"/>
		<title type="html"><![CDATA[Help with joinmsg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87367#p87367"><![CDATA[
I was hoping for a slight explanation of the fields and any relationship.. but here it goes...<br><br>Generic syntax for inserts:<div class="codebox"><p>Code: </p><pre><code>INSERT INTO table (field1, field2) VALUES (data1, data2)</code></pre></div>In this case, you've got two auto_increment-fields, so you should not set these. This leaves us with "username", "class" for the joinmsgircuser table, and "nick", "userid" for the joinmsgnicks table.<br><br>The code you've posted suggests joinmsgnicks.userid links with joinmsgircuser.id, but you'll have to confirm this...<br><br>In order to retrieve the last_insertid, use the <strong class="text-strong">mysqlinsertid</strong> command.<br><br>Btw, I am a bit puzzled as to why you repeat the same query.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu Feb 12, 2009 11:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Fire-Fox]]></name></author>
		<updated>2009-02-12T11:27:42-04:00</updated>

		<published>2009-02-12T11:27:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87365#p87365</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87365#p87365"/>
		<title type="html"><![CDATA[Help with joinmsg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87365#p87365"><![CDATA[
<blockquote class="uncited"><div>Assuming the account has insert/update privileges for the table, sure.<br><br>Would be a mere matter of a proper INSERT query sent using the <strong class="text-strong">mysqlquery</strong> command<br>Since I don't know the table structure for your database, I really can't say much more than that.</div></blockquote>Hey again <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Here is the table structure <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><div class="codebox"><p>Code: </p><pre><code>CREATE TABLE `joinmsgircuser` (  `id` int(10) unsigned NOT NULL auto_increment,  `username` varchar(40) NOT NULL default '',  `class` tinyint(3) unsigned NOT NULL default '1',  PRIMARY KEY  (`id`),  UNIQUE KEY `username` (`username`),  KEY `username_status` (`username`)) TYPE=MyISAM AUTO_INCREMENT=32 ;CREATE TABLE `joinmsgnicks` (  `id` int(16) NOT NULL auto_increment,  `nick` varchar(32) NOT NULL default '',  `userid` int(16) default NULL,  PRIMARY KEY  (`id`)) TYPE=MyISAM AUTO_INCREMENT=33 ;</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8230">Fire-Fox</a> — Thu Feb 12, 2009 11:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-02-12T11:13:34-04:00</updated>

		<published>2009-02-12T11:13:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87364#p87364</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87364#p87364"/>
		<title type="html"><![CDATA[Help with joinmsg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87364#p87364"><![CDATA[
Assuming the account has insert/update privileges for the table, sure.<br><br>Would be a mere matter of a proper INSERT query sent using the <strong class="text-strong">mysqlquery</strong> command<br>Since I don't know the table structure for your database, I really can't say much more than that.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu Feb 12, 2009 11:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Fire-Fox]]></name></author>
		<updated>2009-02-12T08:07:00-04:00</updated>

		<published>2009-02-12T08:07:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87362#p87362</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87362#p87362"/>
		<title type="html"><![CDATA[Help with joinmsg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87362#p87362"><![CDATA[
Sorry for bump <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><br><br>Is it possible to add so i can add the users via !tcl commands instead of i have to login to the mysql to add the users?<br><br>the output : <blockquote class="uncited"><div>[@LillePil] Welcome To ::: Apache ::: Bot Commander</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8230">Fire-Fox</a> — Thu Feb 12, 2009 8:07 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Fire-Fox]]></name></author>
		<updated>2009-02-10T18:03:32-04:00</updated>

		<published>2009-02-10T18:03:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87340#p87340</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87340#p87340"/>
		<title type="html"><![CDATA[Help with joinmsg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87340#p87340"><![CDATA[
Yes i noticed, i tryed with +joinmsg, and made a /hop (the bot reply with the welcome msg) and then with -joinmsg (Nothing happend) <br><br>so i must say it works <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8230">Fire-Fox</a> — Tue Feb 10, 2009 6:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-02-10T17:59:47-04:00</updated>

		<published>2009-02-10T17:59:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87339#p87339</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87339#p87339"/>
		<title type="html"><![CDATA[Help with joinmsg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87339#p87339"><![CDATA[
That would be the proper way of testing whether "joinmsg" is set for the specific channel, yes.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Feb 10, 2009 5:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Fire-Fox]]></name></author>
		<updated>2009-02-10T17:46:14-04:00</updated>

		<published>2009-02-10T17:46:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87338#p87338</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87338#p87338"/>
		<title type="html"><![CDATA[Help with joinmsg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87338#p87338"><![CDATA[
Hey <br><br>I did the following thing<br><div class="codebox"><p>Code: </p><pre><code>proc bt.join.class { chan nick class} {[b]if {[channel get $chan joinmsg]} { [/b]switch $class {   ### The number is the number of the class on the site   ### "return 0" means no msg for that class   "default"{set class "Not Found" }  }[b] }[/b]}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8230">Fire-Fox</a> — Tue Feb 10, 2009 5:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-02-10T17:34:50-04:00</updated>

		<published>2009-02-10T17:34:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87337#p87337</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87337#p87337"/>
		<title type="html"><![CDATA[Help with joinmsg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87337#p87337"><![CDATA[
I must say you pretty much answered your own question there..<br>To define the custom channel flag "joinmsg", make sure the following piece of code to your script, in such fashion that it will be executed as the script loads (usually in the top of the script):<div class="codebox"><p>Code: </p><pre><code>setudef flag joinmsg</code></pre></div>Once this is done, this flag can be used just like any other flag available in your eggdrop. You probably would like to read up on the <strong class="text-strong">channel</strong> command (doc/tcl-commands.doc), especially the <span style="text-decoration:underline">get</span> option.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Feb 10, 2009 5:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Fire-Fox]]></name></author>
		<updated>2009-02-10T17:11:41-04:00</updated>

		<published>2009-02-10T17:11:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87336#p87336</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87336#p87336"/>
		<title type="html"><![CDATA[Help with joinmsg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87336#p87336"><![CDATA[
Hey how do i add the <blockquote class="uncited"><div>setudef flag</div></blockquote> ??<br><br>Something like : <blockquote class="uncited"><div>setudef flag joinmsg</div></blockquote><div class="codebox"><p>Code: </p><pre><code>package require mysqltclbind join - * join:testareabind rejn - * join:testarea##################### Mysql path ###################### SQL infoset sql(host) "xxxxxxxxxx"set sql(user) "xxxxxxxxxx"set sql(pass) "xxxxxxxxxx"set sql(db) "xxxxxxxxxx"set sql(port) "xxxx"##################### Mysql path #####################if {![info exists db_handle] } {set db_handle [mysqlconnect -host $sql(host) -user $sql(user) -password $sql(pass) -db $sql(db) -port $sql(port)] }############################################## Greeting MSG When User Join channel ##############################################proc bt.join.class { chan nick class} {switch $class {   ### The number is the number of the class on the site   ### "return 0" means no msg for that class   "default"{set class "Not Found" } }}#################### Join Proc ####################proc join:testarea {nick host hand chan} {global botnick db_handle  if {$nick != $botnick} {         if {[mysqlping $db_handle] != 1} {            putserv "PRIVMSG $chan : The connection to the mysql server has been lost."             return 0       }              set sqlnick "SELECT userid FROM joinmsgnicks WHERE nick='[mysqlescape $nick]'"       set resultnick [mysqlquery $db_handle $sqlnick]                    set nicki 0       while {[set record [mysqlnext $resultnick]] != ""} {         set userid [lindex $record 0]         incr nicki       }                     if { $nicki == 0 } { return 0 }                    if { $userid == "" } { return 0 }                    set sql "SELECT username, class FROM joinmsgircuser WHERE id='[mysqlescape $userid]'"              set result [mysqlquery $db_handle $sql]                    set i 0       while {[set record [mysqlnext $result]] != ""} {                             set username [lindex $record 0];         set class [lindex $record 1];       }              set sql "SELECT username, class FROM joinmsgircuser WHERE id='[mysqlescape $userid]'"       set result [mysqlquery $db_handle $sql]                    set i 0       while {[set record [mysqlnext $result]] != ""} {                             set username [lindex $record 0];         set class [lindex $record 1];       }       mysqlendquery $result              bt.join.class $chan $nick $class    }  }  putlog "Joinmsg"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8230">Fire-Fox</a> — Tue Feb 10, 2009 5:11 pm</p><hr />
]]></content>
	</entry>
	</feed>
