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

	<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-01-12T06:03:50-04:00</updated>

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

		<entry>
		<author><name><![CDATA[garfwen]]></name></author>
		<updated>2009-01-12T06:03:50-04:00</updated>

		<published>2009-01-12T06:03:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86876#p86876</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86876#p86876"/>
		<title type="html"><![CDATA[Need a little help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86876#p86876"><![CDATA[
Thanks, it works  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9777">garfwen</a> — Mon Jan 12, 2009 6:03 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-01-06T18:47:05-04:00</updated>

		<published>2009-01-06T18:47:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86750#p86750</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86750#p86750"/>
		<title type="html"><![CDATA[Need a little help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86750#p86750"><![CDATA[
If say it is always the last two characters of the variable chan that represent the country code then you can extract it using 'string range' as follows :-<br><br>[string range $chan end-1 end]<br><br>If you are unsure of exactly what the bot knows the channel as in terms of case, I would recommend :-<br><br>[string toupper [string range $chan end-1 end]]<br><br>The following script could be used to output both the country code and the country name in a channel using the public command !locale (if it exists in the preset array).<br><br>array set varCountries {<br>    PT "Portugal"<br>    UK "United Kingdom"<br>    ES "Spain"<br>}<br><br>bind PUB - !locale prcLocale<br><br>proc prcLocale {nick uhost hand chan text} {<br>    global varCountries<br>    set code [string toupper [string range $chan end-1 end]]<br>    if {[info exists varCountries($code)]} {<br>        putserv "PRIVMSG $chan :The channel locale is $varCountries($code) ($code)"<br>    } else {<br>        putserv "PRIVMSG $chan :The channel locale is unknown"<br>    }<br>    return 0<br>}<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Tue Jan 06, 2009 6:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[garfwen]]></name></author>
		<updated>2009-01-06T17:59:30-04:00</updated>

		<published>2009-01-06T17:59:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86749#p86749</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86749#p86749"/>
		<title type="html"><![CDATA[Need a little help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86749#p86749"><![CDATA[
Hello guys<br><br>I have some channels like this:<br><br>#1.channel.PT<br>#2.channel.UK<br>#3.channel.ES<br>etc.<br><br>Now my question is how can i get the country in a var ?<br><br>Example:<div class="codebox"><p>Code: </p><pre><code>(chan == #1.channel.pt)&lt;nick&gt; .language&lt;botnick&gt; This channel is PT</code></pre></div>Thnx<br>GaRfWeN<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9777">garfwen</a> — Tue Jan 06, 2009 5:59 pm</p><hr />
]]></content>
	</entry>
	</feed>
