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

	<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>2006-09-25T01:41:45-04:00</updated>

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

		<entry>
		<author><name><![CDATA[metroid]]></name></author>
		<updated>2006-09-25T01:41:45-04:00</updated>

		<published>2006-09-25T01:41:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66659#p66659</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66659#p66659"/>
		<title type="html"><![CDATA[Help with getting info from site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66659#p66659"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc stats:private {nick uhost hand chan text} {  if {[set target [lindex [split $text] 0]] == ""} {    set target $nick  }  set site "http://kewlbot.us.jerrcs.net/stats2.php?name=$target"  set token [::http::geturl $site]  set content [::http::data $token]  ::http::cleanup $content  putserv "NOTICE $nick :\0035,0Runescape\00314,0 Hiscores Lookup for \0035,0$target\00314,0:\003"  set line [string trim $content]  putserv "NOTICE $nick :\00314,0$line\003"} </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5078">metroid</a> — Mon Sep 25, 2006 1:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Hamish]]></name></author>
		<updated>2006-09-24T14:59:58-04:00</updated>

		<published>2006-09-24T14:59:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66649#p66649</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66649#p66649"/>
		<title type="html"><![CDATA[Help with getting info from site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66649#p66649"><![CDATA[
Sorry I didn't explain very well, I need it to return the statistics for the persons nickname if they don't specify a name, for example:<br><blockquote class="uncited"><div>&lt;RandomGuy&gt; !stats<br>-Bot- Stats for RandomGuy<br>-Bot- Blablabla</div></blockquote>Thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7551">Hamish</a> — Sun Sep 24, 2006 2:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-09-22T16:45:37-04:00</updated>

		<published>2006-09-22T16:45:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66576#p66576</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66576#p66576"/>
		<title type="html"><![CDATA[Help with getting info from site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66576#p66576"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>proc stats:private {nick uhost hand chan text} {  if {![lindex $text 0]} {    set rsname $nick  } else {    set rsname [lindex $text 0]  }</code></pre></div>Basically if the user doesn't specify a name (!stats NAME) it just uses there  nickname instead. Please help. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"></div></blockquote>That's because you have "set rsname $nick" there.  If you want it to return an error msg or help msg, I'd change "if {[$lindex $text 0]}" to <div class="codebox"><p>Code: </p><pre><code>if {$text == ""} {    puthelp "PRIVMSG $nick :Please supply a name!";return} else {</code></pre></div>I would also suggest that you [split $text] to prevent problems with tcl special chars.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Fri Sep 22, 2006 4:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Hamish]]></name></author>
		<updated>2006-09-22T15:00:54-04:00</updated>

		<published>2006-09-22T15:00:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66571#p66571</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66571#p66571"/>
		<title type="html"><![CDATA[Help with getting info from site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66571#p66571"><![CDATA[
Ok, fixed up that (used string trim).<br>Now I have this code, it doesn't work, please tell me whats wrong with it.<br><div class="codebox"><p>Code: </p><pre><code>proc stats:private {nick uhost hand chan text} {  if {![lindex $text 0]} {    set rsname $nick  }  else {    set rsname [lindex $text 0]  }  set site "http://kewlbot.us.jerrcs.net/stats2.php?name=$rsname"  set token [::http::geturl $site]  set content [::http::data $token]  ::http::cleanup $content  putserv "NOTICE $nick :\0035,0Runescape\00314,0 Hiscores Lookup for \0035,0$rsname\00314,0:\003"  set line [string trim $content]  putserv "NOTICE $nick :\00314,0$line\003"} </code></pre></div>Basically if the user doesn't specify a name (!stats NAME) it just uses there  nickname instead. Please help. <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=7551">Hamish</a> — Fri Sep 22, 2006 3:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Nara]]></name></author>
		<updated>2006-09-22T07:17:08-04:00</updated>

		<published>2006-09-22T07:17:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66552#p66552</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66552#p66552"/>
		<title type="html"><![CDATA[Help with getting info from site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66552#p66552"><![CDATA[
Cancel out the ( using a \ and the ) with a \. That should do it.<br><br>~Nara<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8006">Nara</a> — Fri Sep 22, 2006 7:17 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Hamish]]></name></author>
		<updated>2006-09-20T11:10:41-04:00</updated>

		<published>2006-09-20T11:10:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66486#p66486</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66486#p66486"/>
		<title type="html"><![CDATA[Help with getting info from site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66486#p66486"><![CDATA[
Ok, rockon thanks.<br><br>I now have this, I have added some stuff for design reasons:<br><div class="codebox"><p>Code: </p><pre><code>bind pub - !stats stats:privateproc stats:private {nick uhost hand chan text} {  set rsname [lindex $text 0]  set site "http://*/stats2.php?name=$rsname"  set token [::http::geturl $site]  set content [::http::data $token]  ::http::cleanup $content    putserv "NOTICE $nick :\0032,0(\0035,0Runescape hiscores lookup for\0032,0 $rsname)\003"  foreach line [split $content \n] {    putserv "NOTICE $nick :\0032,0(\0035,0$line\0032,0)\003"  }}</code></pre></div>Ok, so now it looks nice but:<br><blockquote class="uncited"><div>-Bot- (Runescape Hiscores Lookup for hamish150)<br>-Bot- (Overall: 970 Attack: 64 Defence: 60 Strength: 59 Hitpoints: 61 Ranged: 51 Prayer: 41 Magic: 50 Cooking: 62 Woodcutting: 56 Fletching: 34 Fishing: 61 Firemaking: 41 Crafting: 49 Mining: 55 Agility: 40 Thieving: 37 Slayer: 31 )<br>-Bot- ()</div></blockquote>What's with the extra ()?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7551">Hamish</a> — Wed Sep 20, 2006 11:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2006-09-20T09:00:59-04:00</updated>

		<published>2006-09-20T09:00:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66485#p66485</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66485#p66485"/>
		<title type="html"><![CDATA[Help with getting info from site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66485#p66485"><![CDATA[
<blockquote class="uncited"><div>Cool, thanks. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> <br><br>Do you think you could help me with colours too?</div></blockquote><a href="http://forum.egghelp.org/viewtopic.php?t=3867" class="postlink">Colour and formatting codes</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Wed Sep 20, 2006 9:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Hamish]]></name></author>
		<updated>2006-09-20T03:00:48-04:00</updated>

		<published>2006-09-20T03:00:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66481#p66481</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66481#p66481"/>
		<title type="html"><![CDATA[Help with getting info from site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66481#p66481"><![CDATA[
Cool, thanks. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> <br><br>Do you think you could help me with colours too?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7551">Hamish</a> — Wed Sep 20, 2006 3:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2006-09-19T14:54:40-04:00</updated>

		<published>2006-09-19T14:54:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66465#p66465</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66465#p66465"/>
		<title type="html"><![CDATA[Help with getting info from site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66465#p66465"><![CDATA[
Move the<blockquote class="uncited"><div>putserv "NOTICE $nick :Runescape hiscores lookup for $rsname" </div></blockquote>before (outside) the loop (foreach) and should say that just once.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Sep 19, 2006 2:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Hamish]]></name></author>
		<updated>2006-09-19T11:58:45-04:00</updated>

		<published>2006-09-19T11:58:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66462#p66462</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66462#p66462"/>
		<title type="html"><![CDATA[Help with getting info from site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66462#p66462"><![CDATA[
Ok I got this so far:<br><div class="codebox"><p>Code: </p><pre><code>bind pub - !stats stats:privateproc stats:private {nick uhost hand chan text} {  set rsname [lindex $text 0]  set site "http://*/stats2.php?name=$rsname"  set token [::http::geturl $site]  set content [::http::data $token]  ::http::cleanup $content  foreach line [split $content \n] {    putserv "NOTICE $nick :Runescape hiscores lookup for $rsname"    putserv "NOTICE $nick :$line"  }} </code></pre></div>I get this error:<br><blockquote class="uncited"><div>-Bot- Runescape hiscores lookup for hamish150<br>-Bot- Overall: 970 Attack: 64 Defence: 60 Strength: 59 Hitpoints: 61 Ranged: 51 Prayer: 41 Magic: 50 Cooking: 62 Woodcutting: 56 Fletching: 34 Fishing: 61 Firemaking: 41 Crafting: 49 Mining: 55 Agility: 40 Thieving: 37 Slayer: 31 <br>-Bot- Runescape hiscores lookup for hamish150</div></blockquote>The site it connects is a single line containing the stats as shown in the second notice. What I need to do is, get rid of the third notice (the repeat of the the first one). I also need to know how to put it into colour, and, for the second notice to put all the words in darkred (5,0) and the numbers in darkblue (2,0).<br><br>I also need it so that if there are no numbers in $line it will return that the user's hiscores aren't ranked.<br><br>Also how would I be able to make it so that if the user types two words or more as a name, for example:<br><br>!stats jim bob jones<br><br>It will set $rsname as jim_bob_jones?<br><br>Thanks!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7551">Hamish</a> — Tue Sep 19, 2006 11:58 am</p><hr />
]]></content>
	</entry>
	</feed>
