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

	<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>2005-11-24T01:38:26-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2005-11-24T01:38:26-04:00</updated>

		<published>2005-11-24T01:38:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=57665#p57665</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=57665#p57665"/>
		<title type="html"><![CDATA[somebody can help me to repair forex.tcl ??]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=57665#p57665"><![CDATA[
<blockquote class="uncited"><div>bad data in 'firstline' from currency server - please notify the <strong class="text-strong">bot admin</strong>.</div></blockquote>Missing something?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Thu Nov 24, 2005 1:38 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[planetdata]]></name></author>
		<updated>2005-11-23T23:30:53-04:00</updated>

		<published>2005-11-23T23:30:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=57661#p57661</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=57661#p57661"/>
		<title type="html"><![CDATA[somebody can help me to repair forex.tcl ??]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=57661#p57661"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set fx_debug 0set fx_chans "*"set fx_command "@rate"set fx_search "@symbol"set fx_flags "-|-"# exempt from flood and can use commands on _any_ channelset fx_exempt "n|n"# number:seconds:disableset fx_flood 5:20:120set fx_maxresults 5# %nick %mkttime %fromresult %fromsymbol %toresult %tosymbol %exrate %extime %timezoneset fx_format {  "%nick: %fromresult (%fromsymbol) = %toresult (%tosymbol) \[Rate: %exrate at %extime %timezone\]  \[Updated: %mkttime\]"}set fx_timezone "SGT"set fx_symbols {  {AFA {Afghanistan Afghani}}  {ALL {Albanian Lek}}  {DZD {Algerian Dinar}}  {ADF {Andorran Franc}}  {ADP {Andorran Peseta}}  {ARS {Argentine Peso}}  {AWG {Aruba Florin}}  {AUD {Australian Dollar}}  {ATS {Austrian Schilling}}  {BSD {Bahamian Dollar}}  {BHD {Bahraini Dinar}}  {BDT {Bangladesh Taka}}  {BBD {Barbados Dollar}}  {BEF {Belgian Franc}}  {BZD {Belize Dollar}}  {BMD {Bermuda Dollar}}  {BTN {Bhutan Ngultrum}}  {BOB {Bolivian Boliviano}}  {BWP {Botswana Pula}}  {BRL {Brazilian Real}}  {GBP {British Pound}}  {BND {Brunei Dollar}}  {BIF {Burundi Franc}}  {KHR {Cambodia Riel}}  {CAD {Canadian Dollar}}  {KYD {Cayman Islands Dollar}}  {CLP {Chilean Peso}}  {CNY {Chinese Yuan}}  {COP {Colombian Peso}}  {KMF {Comoros Franc}}  {CRC {Costa Rica Colon}}  {HRK {Croatian Kuna}}  {CYP {Cyprus Pound}}  {CUP {Cuban Peso}}  {CZK {Czech Koruna}}  {DKK {Danish Krone}}  {DOP {Dominican Peso}}  {NLG {Dutch Guilder}}  {XCD {East Caribbean Dollar}}  {ECS {Ecuadorian Sucre}}  {EGP {Egyptian Pound}}  {SVC {El Salvador Colon}}  {EEK {Estonian Kroon}}  {EUR {Euro}}  {ETB {Ethiopian Birr}}  {FKP {Falkland Islands Pound}}  {FJD {Fiji Dollar}}  {FIM {Finnish Mark}}  {FRF {French Franc}}  {GMD {Gambian Dalasi}}  {DEM {German Mark}}  {GHC {Ghanian Cedi}}  {GIP {Gibraltar Pound}}  {XAU {Gold Ounces}}  {GRD {Greek Drachma}}  {GTQ {Guatemala Quetzal}}  {GNF {Guinea Franc}}  {GYD {Guyana Dollar}}  {HTG {Haiti Gourde}}  {HNL {Honduras Lempira}}  {HKD {Hong Kong Dollar}}  {HUF {Hungarian Forint}}  {ISK {Iceland Krona}}  {IDR {Indonesian Rupiah}}  {INR {Indian Rupee}}  {IRD {Iragi Dinar}}  {IEP {Irish Punt}}  {ILS {Israeli Shekel}}  {ITL {Italian Lira .L}}  {JPY {Japanese Yen}}  {JMD {Jamaican Dollar}}  {JOD {Jordanian Dinar}}  {KZT {Kazakhstan Tenge}}  {KES {Kenyan Shilling}}  {KRW {Korean Won}}  {KWD {Kuwaiti Dinar}}  {LBP {Lebanese Pound}}  {LRD {Liberian Dollar}}  {LYD {Libyan Dinar}}  {LUF {Luxembourg Franc}}  {MOP {Macau Pataca}}  {MYR {Malaysian Ringgit}}  {MVR {Maldives Rufiyaa}}  {MUR {Mauritius Rupee}}  {MXN {Mexican Nuevo Peso}}  {MNT {Mongolian Tugrik}}  {MAD {Moroccan Dirham}}  {MZM {Mozambique Metical}}  {MMK {Myanmar Kyat}}  {NAD {Namibian Dollar}}  {NZD {New Zealand Dollar}}  {NPR {Nepalese Rupee}}  {NIO {Nicaragua Cordoba}}  {KPW {North Korean Won}}  {NOK {Norwegian Krone}}  {OMR {Omani Rial}}  {PKR {Pakistani Rupee}}  {PAB {Panama Balboa}}  {PGK {Papua New Guinea Kina}}  {PYG {Paraguayan Guarani}}  {XPT {Platinum Ounces}}  {PHP {Philippine Peso}}  {PTE {Portuguese Escudo}}  {QAR {Qatar Rial}}  {RUB {Russian Rouble}}  {SOS {Somali Shilling}}  {ZAR {South African Rand}}  {LKR {Sri Lanka Rupee}}  {XAG {Silver Ounces}}  {SGD {Singapore Dollar}}  {ESP {Spanish Peseta}}  {SDD {Sudanese Dinar}}  {SRG {Surinam Guilder}}  {SEK {Swedish Krona}}  {CHF {Swiss Franc}}  {TWD {Taiwan Dollar}}  {THB {Thai Baht}}  {TND {Tunisian Dinar}}  {TRL {Turkish Lira}}  {USD {U.S. Dollar}}  {UYU {Uruguayan New Peso}}  {UGX {Ugandan Shilling}}  {UAH {Ukraine Hryvnia}}  {VND {Vietnam Dong}}  {VEB {Venezuelan Bolivar}}  {YUM {Yogoslav Dinar}}  {ZMK {Zambian Kwacha}}  {ZWD {Zimbabwe Dollar}}}# Don't edit below unless you know what you're doing.if {[catch {package require http}]} {  putlog "forex: Error - could not find package 'http'. Script not loaded. Make sure you are running Tcl 8.0 or later."}proc fx_get {amount from to} {  global fx_debug  if {[catch {::http::geturl http://sg.finance.yahoo.com/m5?a=$amount&amp;s=$from&amp;t=$to} token]} {    return "noconnect"  }  set lines [split [::http::data $token] \n]  unset $token  if {$fx_debug} {    set wfile [open forex_debug.txt w]    puts -nonewline $wfile [join $lines \n]    close $wfile  }  if {[set firstline [lsearch -exact $lines "Conversion&lt;/font&gt;&lt;/b&gt;&lt;/big&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;"]] != -1} {    set lines [lrange $lines $firstline end]  } else {    return {baddata firstline}  }  set line [lindex $lines 3]  set line [string range $line [expr [string first "&gt;" $line] + 1] end]  set mkttime [string range $line 0 [expr [string first "&lt;" $line] - 1]]  set line [lindex $lines 8]  set line [string range $line [expr [string first "&lt;/a&gt;&lt;/th&gt;&lt;th&gt;" $line] + 13] end]  set fromresult [string range $line 0 [expr [string first "&lt;" $line] - 1]]  set line [string range $line [expr [string first "&lt;th nowrap&gt;" $line] + 11] end]  set extime [string range $line 0 [expr [string first "&lt;" $line] - 1]]  set line [string range $line [expr [string first "&lt;/th&gt;&lt;td&gt;" $line] + 9] end]  set exrate [string range $line 0 [expr [string first "&lt;" $line] - 1]]  set line [string range $line [expr [string first "&lt;/td&gt;&lt;td&gt;&lt;b&gt;" $line] + 12] end]  set toresult [string range $line 0 [expr [string first "&lt;" $line] - 1]]  if {$mkttime == ""} {    return {baddata mkttime}  }  if {$fromresult == ""} {    return {baddata fromresult}  }  if {$extime == ""} {    return {baddata extime}  }  if {$exrate == ""} {    return {baddata exrate}  }  if {$toresult == ""} {    return {baddata toresult}  }  return [list $mkttime $fromresult $toresult $exrate $extime]}proc fx_pubforex {nick uhost hand chan arg} {  global fx_command fx_format fx_search fx_symbol fx_timezone  if {[fx_cmdcheck $hand $chan]} {return 0}  set splitarg [split $arg]  if {[llength $splitarg] &gt;= 3} {    set amount [lindex $splitarg 0]    set from [string toupper [lindex $splitarg 1]]    set to [string toupper [lindex $splitarg 2]]  } else {    set amount 1    set from [string toupper [lindex $splitarg 0]]    set to [string toupper [lindex $splitarg 1]]  }  if {$amount == "" || $from == "" || $to == ""} {    puthelp "NOTICE $nick :Usage: $fx_command \[amount\] &lt;from currency&gt; &lt;to currency&gt;"    puthelp "NOTICE $nick :If no amount is specified, it will default to '1'. You must specify currency symbols (e.g. $fx_command 120 USD IND). To look up a symbol for a currency, type $fx_search &lt;country name&gt;"    return 0  }  if {[catch {expr abs($amount)}]} {    puthelp "NOTICE $nick :$amount is not a numeric value."    return 0  }  if {[string length $amount] &gt; 20} {    puthelp "NOTICE $nick :Please limit the amount to 20 characters or less."    return 0  }  if {![info exists fx_symbol($from)]} {    puthelp "NOTICE $nick :$from is not a valid currency symbol. To look up a symbol for a currency, type $fx_search &lt;country name&gt;"    return 0  }  if {![info exists fx_symbol($to)]} {    puthelp "NOTICE $nick :$to is not a valid currency symbol. To look up a symbol for a currency, type $fx_search &lt;country name&gt;"    return 0  }  set results [fx_get $amount $from $to]  if {[lindex $results 0] == "noconnect"} {    puthelp "PRIVMSG $chan :$nick: unable to connect to currency server."    return 0  } elseif {[lindex $results 0] == "baddata"} {    puthelp "PRIVMSG $chan :$nick: bad data in '[lindex $results 1]' from currency server - please notify the bot admin."    return 0  }  foreach line $fx_format {    regsub -all -- "%nick" $line $nick line    regsub -all -- "%mkttime" $line [lindex $results 0] line    regsub -all -- "%fromresult" $line [lindex $results 1] line    regsub -all -- "%fromsymbol" $line $fx_symbol($from) line    regsub -all -- "%toresult" $line [lindex $results 2] line    regsub -all -- "%tosymbol" $line $fx_symbol($to) line    regsub -all -- "%exrate" $line [lindex $results 3] line    regsub -all -- "%extime" $line [lindex $results 4] line    regsub -all -- "%timezone" $line $fx_timezone line    puthelp "PRIVMSG $chan :$line"  }  return 1}proc fx_pubsearch {nick uhost hand chan arg} {  global fx_maxresults fx_search fx_symbol  if {[fx_cmdcheck $hand $chan]} {return 0}  if {$arg == ""} {    puthelp "NOTICE $nick :Usage: $fx_search &lt;search string&gt;"    return 0  }  foreach symbol [array names fx_symbol] {    if {[string match *[string tolower $arg]* [string tolower $fx_symbol($symbol)]]} {      lappend results "$symbol $fx_symbol($symbol)"    }  }  if {[info exists results]} {    if {[llength $results] &gt; $fx_maxresults} {      puthelp "NOTICE $nick :Found [llength $results] result(s) for '$arg', displaying first $fx_maxresults"    } else {      puthelp "NOTICE $nick :Found [llength $results] result(s) for '$arg'"    }    foreach result [lrange $results 0 [expr $fx_maxresults - 1]] {      puthelp "NOTICE $nick :$result"    }  } else {    puthelp "NOTICE $nick :No matches for '$arg'."  }  return 1}proc fx_cmdcheck {hand {chan ""}} {  global fx_chans fx_exempt fx_flood fx_flooded fx_floodqueue  if {$fx_flooded} {return 1}  if {$chan != ""} {    if {$fx_exempt != "" &amp;&amp; [matchattr $hand $fx_exempt $chan]} {return 0}    if {[lsearch -exact $fx_chans [string tolower $chan]] == -1} {return 1}  } else {    if {$fx_exempt != "" &amp;&amp; [matchattr $hand $fx_exempt]} {return 0}  }  incr fx_floodqueue  utimer [lindex $fx_flood 1] {incr fx_floodqueue -1}  if {$fx_floodqueue &gt;= [lindex $fx_flood 0]} {    set fx_flooded 1    utimer [lindex $fx_flood 2] {set fx_flooded 0}    putlog "forex: Flooding detected - disabling commands for [lindex $fx_flood 2] seconds."    return 1  }  return 0}foreach fx_tempsymbol $fx_symbols {  set fx_symbol([lindex $fx_tempsymbol 0]) [lindex $fx_tempsymbol 1]}unset fx_symbolsset fx_chans [split [string tolower $fx_chans]]set fx_flood [split $fx_flood :]if {![info exists fx_flooded]} {  set fx_flooded 0}if {![info exists fx_floodqueue]} {  set fx_floodqueue 0}::http::config -useragent "Mozilla/4.0 (compatible; MSIE 5.0; Windows 98)"bind pub $fx_flags $fx_command fx_pubforexbind pub $fx_flags $fx_search fx_pubsearchif {![info exists nb_component([file tail [file rootname [info script]]])]} {  putlog "forex.tcl loaded"}return "nb_info 1.27.0"</code></pre></div>the error msg from the bot :<br>bad data in 'firstline' from currency server - please notify the bot admin.<br><br>somebody can help me??<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7021">planetdata</a> — Wed Nov 23, 2005 11:30 pm</p><hr />
]]></content>
	</entry>
	</feed>
