<?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/13596" />

	<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>2007-06-15T09:26:51-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2007-06-15T09:26:51-04:00</updated>

		<published>2007-06-15T09:26:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73570#p73570</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73570#p73570"/>
		<title type="html"><![CDATA[Help With .adduser this shud be simple to most]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73570#p73570"><![CDATA[
If you bothered to actually read the syntax (posted above) and compared it to what you're not actually doing you'd figure it out.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Fri Jun 15, 2007 9:26 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[masheen]]></name></author>
		<updated>2007-06-14T23:10:10-04:00</updated>

		<published>2007-06-14T23:10:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73560#p73560</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73560#p73560"/>
		<title type="html"><![CDATA[Help With .adduser this shud be simple to most]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73560#p73560"><![CDATA[
not really my best trait to give up but i have tried everything my brain has to offer to solve this problem but i could not get the adduser to work as nided..gues i have no choice but to post on the script request section. haha. thanks guys for the help. really appreciate it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8950">masheen</a> — Thu Jun 14, 2007 11:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2007-06-13T09:49:55-04:00</updated>

		<published>2007-06-13T09:49:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73524#p73524</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73524#p73524"/>
		<title type="html"><![CDATA[Help With .adduser this shud be simple to most]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73524#p73524"><![CDATA[
<blockquote class="uncited"><div>  adduser &lt;handle&gt; [hostmask]<br>    Description: creates a new user entry with the handle and hostmask given<br>      (with no password and the default flags)<br>    Returns: 1 if successful; 0 if the handle already exists<br>    Module: core</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Wed Jun 13, 2007 9:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[masheen]]></name></author>
		<updated>2007-06-13T05:26:03-04:00</updated>

		<published>2007-06-13T05:26:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73517#p73517</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73517#p73517"/>
		<title type="html"><![CDATA[Help With .adduser this shud be simple to most]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73517#p73517"><![CDATA[
ok fixed the redundant validuser check on else clause thanks. as for the error, i dont have any on both telnet and on dcc everytime the .adduser is being triggered... as well as on the logs. nada! any ideas left? i am sure the adduser is triggered cos i put these lines to make sure that the adduser is triggered and amazingly produces no errors on logs, and both DCC and telnet console:<br><div class="codebox"><p>Code: </p><pre><code>if {[...]} {     puthelp "PRIVMSG $chan:1st msg before execute"     adduser [getchanhost $anick $chan]     puthelp "PRIVMSG $chan:2nd msg after execute"}</code></pre></div>just to make sure i am indeed executing the adduser command. but no luck.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8950">masheen</a> — Wed Jun 13, 2007 5:26 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-06-12T13:08:26-04:00</updated>

		<published>2007-06-12T13:08:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73492#p73492</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73492#p73492"/>
		<title type="html"><![CDATA[Help With .adduser this shud be simple to most]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73492#p73492"><![CDATA[
This section is.. well... goofed up:<br><div class="codebox"><p>Code: </p><pre><code> if {[validuser $anick]} {  putserv "PRIVMSG $chan :ERROR: $anick is already in my userlist."  return 0 } else {  if {![validuser $anick]} {   adduser $anick $gethost   putserv "PRIVMSG $chan :$anick has been added to my userlist. database updated."   return 0  } }</code></pre></div>Since we're using an else-clause, doing a second test on the same conditional is pretty pointless, drop the "if {![validuser $anick]} {"...<br><br>As for user not being added to your userlist, do you get any error messages on your partyline console or logs?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Jun 12, 2007 1:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[masheen]]></name></author>
		<updated>2007-06-12T10:59:20-04:00</updated>

		<published>2007-06-12T10:59:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73491#p73491</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73491#p73491"/>
		<title type="html"><![CDATA[Help With .adduser this shud be simple to most]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73491#p73491"><![CDATA[
for the sake of making it clear heres the code with some of the changes you mentioned<br><div class="codebox"><p>Code: </p><pre><code>bind pub -|- !auser pub:adduserproc pub:adduser {nick uhost hand chan text} {        set l_text [split $text]set anick [lindex $l_text 0]set gethost [lindex $l_text 1]        if {![matchattr $nick n|m $chan]}  {               putserv "PRIVMSG $chan :ERROR: this is a botowner command."       return 0        }if {![onchan $anick $chan]} {putserv "PRIVMSG $chan :ERROR: $anick is not on $chan. aborting command."return 0}if {$anick == ""}   {               putserv "PRIVMSG $chan :ERROR: usage is !auser &lt;handle/nick&gt;."               return 0        }if {[validuser $anick]} {putserv "PRIVMSG $chan :ERROR: $anick is already in my userlist."       return 0} else {if {![validuser $anick]} {adduser $anick $gethostputserv "PRIVMSG $chan :$anick has been added to my userlist. database updated."       return 0}} }</code></pre></div>dont wori bout this one, il change this later <div class="codebox"><p>Code: </p><pre><code>       if {![matchattr $nick n|m $chan]}  {</code></pre></div>my main concern really is to make the adduser work. thanks again.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8950">masheen</a> — Tue Jun 12, 2007 10:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[masheen]]></name></author>
		<updated>2007-06-12T11:05:17-04:00</updated>

		<published>2007-06-12T10:55:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73490#p73490</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73490#p73490"/>
		<title type="html"><![CDATA[Help With .adduser this shud be simple to most]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73490#p73490"><![CDATA[
have done the changes thanks <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> uv bin helpful...now on to my last problem which concerns .adduser<br><br>have tried the following with not much success:<br><div class="codebox"><p>Code: </p><pre><code>adduser $anick</code></pre></div>&amp;<div class="codebox"><p>Code: </p><pre><code>adduser $anick [gethost $anick $chan]</code></pre></div>i even tried this one<div class="codebox"><p>Code: </p><pre><code>set l_text [split $text]set anick [lindex $l_text 0]set gethost [lindex $l_text 1]</code></pre></div>and when i type <strong class="text-strong">!auser Gothix *!kyde@203.111.232.*</strong> which triggers the following:<div class="codebox"><p>Code: </p><pre><code>if {![validuser $anick]} {adduser $anick $gethostputserv "PRIVMSG $chan :$anick has been added to my userlist. database updated."       return 0}</code></pre></div>and on my DCC console i typed: <strong class="text-strong">.whois Gothicx</strong> the bots internal list cud not find him, so its obvious that it wasnt stored.<div class="codebox"><p>Code: </p><pre><code>[10:46] &lt;Masheen&gt; .whois Gothix[10:46] &lt;(bioman)&gt; [09:46] #Masheen# whois Gothix[10:46] &lt;(bioman)&gt; Can't find anyone matching that.</code></pre></div>anything you cud add or advice for the adduser to work? are there any chanset settings or conf settings i missed? thanks thanks a lot for the trouble. this adduser is giving me nightmares lols...but m learning thanks to you guys.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8950">masheen</a> — Tue Jun 12, 2007 10:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-06-12T08:55:47-04:00</updated>

		<published>2007-06-12T08:55:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73484#p73484</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73484#p73484"/>
		<title type="html"><![CDATA[Help With .adduser this shud be simple to most]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73484#p73484"><![CDATA[
First off, change this:<div class="codebox"><p>Code: </p><pre><code>set anick [lindex $text 0]</code></pre></div>into<div class="codebox"><p>Code: </p><pre><code>set l_text [split $text]set anick [lindex $l_text 0]</code></pre></div>Next, this is dangerous and pointless:<div class="codebox"><p>Code: </p><pre><code>if {![matchattr $nick n|n $chan]}  {</code></pre></div>You should only test the handle, not the nickname.<br><br>Also, this could be changed to use an else-clause:<div class="codebox"><p>Code: </p><pre><code>   if {[validuser $anick]} {      putserv "PRIVMSG $chan :ERROR: $anick is already in my userlist."          return 0   }      if {![validuser $anick]} {      ...</code></pre></div>ie:<div class="codebox"><p>Code: </p><pre><code> if {[validuser $anick]} {  putserv "PRIVMSG $chan :ERROR: $anick is already in my userlist." } else {  ...</code></pre></div>As for your second request, removing ~ would be a matter of applying <a href="http://www.tcl.tk/man/tcl8.4/TclCmd/string.htm" class="postlink">string trimleft</a> to trim off any leading ~.<br>As for removing the last number of an IP-host, this is alittle more cumbersome. One way of doing it would be to <a href="http://www.tcl.tk/man/tcl8.4/TclCmd/split.htm" class="postlink">split</a> the hostmask using . as separator, then use lrange to select a sublist from the splitted hostmask (range should be 0 end-1), and then finally <a href="http://www.tcl.tk/man/tcl8.4/TclCmd/join.htm" class="postlink">join</a> it back into a string (using . as joinstring). Of course, for this to work relyable, you'll first have to make sure it really is an IP-host and nothing else.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Jun 12, 2007 8:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[masheen]]></name></author>
		<updated>2007-06-12T07:29:09-04:00</updated>

		<published>2007-06-12T07:29:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73477#p73477</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73477#p73477"/>
		<title type="html"><![CDATA[Help With .adduser this shud be simple to most]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73477#p73477"><![CDATA[
by the way the host attached to the nick shud be in this form:<br><div class="codebox"><p>Code: </p><pre><code>Added [ashe]*!kyde@203.111.232.* with no password.</code></pre></div>this is his original IP:<div class="codebox"><p>Code: </p><pre><code>Address : ~kyde@203.111.232.98</code></pre></div>i tried using this code by the way and it doesnt work cos if u notice the host has to be trimmed and take away the '~' and trim .98 from the host part to get 203.111.232.* as the host. and that i do not know how to do:<div class="codebox"><p>Code: </p><pre><code>adduser $anick [maskhost [getchanhost $anick $chan]]</code></pre></div>pls help a begginer like me <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=8950">masheen</a> — Tue Jun 12, 2007 7:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[masheen]]></name></author>
		<updated>2007-06-12T05:53:08-04:00</updated>

		<published>2007-06-12T05:53:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73470#p73470</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73470#p73470"/>
		<title type="html"><![CDATA[Help With .adduser this shud be simple to most]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73470#p73470"><![CDATA[
the following code merely executes .adduser &lt;nick&gt; when i type <strong class="text-strong">!auser &lt;nick&gt;</strong> my problem is dat i wanted it to add the hostmask along with the nick. i know it can be done using <strong class="text-strong">!auser &lt;nick&gt; &lt;host&gt;</strong> but is it possible to just use !auser &lt;nick&gt; and then a code will just add the hostmask  for the bot to register the nick with? thanks for anyone who can help. anyway heres the simple code i made...its working already but minus the &lt;hostmask&gt;.<br><div class="codebox"><p>Code: </p><pre><code>proc pub:adduser {nick uhost hand chan text} {        set anick [lindex $text 0]        set nlist [countusers]        if {![matchattr $nick n|n $chan]}  {               putserv "PRIVMSG $chan :ERROR: this is a botowner command."       return 0        }if {![onchan $anick $chan]} {putserv "PRIVMSG $chan :ERROR: $anick is not on $chan. aborting command."return 0}if {$anick == ""}   {               putserv "PRIVMSG $chan :ERROR: usage is !auser &lt;handle/nick&gt;."               return 0        }if {[validuser $anick]} {putserv "PRIVMSG $chan :ERROR: $anick is already in my userlist."       return 0}if {![validuser $anick]} {adduser $anick       putserv "PRIVMSG $chan :$anick has been added to my userlist. i now have ($nlist) on my database."       return 0}         putcmdlog "#$nick# added $nick on userlist"}</code></pre></div>and if anyone can improve the above code pls help too. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>by the way my purpose for this is for me to be able to add nicks on my botlist without having to dcc all the time. i just identity to the bot and i can add and del users on public command. some eggdrop begginers like me may find the code a bit usefull for their bots too i hope.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8950">masheen</a> — Tue Jun 12, 2007 5:53 am</p><hr />
]]></content>
	</entry>
	</feed>
