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

	<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-06-25T00:34:32-04:00</updated>

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

		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2006-06-25T00:34:32-04:00</updated>

		<published>2006-06-25T00:34:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64304#p64304</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64304#p64304"/>
		<title type="html"><![CDATA[Help about strings and lists]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64304#p64304"><![CDATA[
you won't have any problems and you don't need to strip those chars as long as you simply output db text and don't pass it to proc's which do evaluation<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Sun Jun 25, 2006 12:34 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cerberus_gr]]></name></author>
		<updated>2006-06-24T09:11:50-04:00</updated>

		<published>2006-06-24T09:11:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64299#p64299</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64299#p64299"/>
		<title type="html"><![CDATA[Help about strings and lists]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64299#p64299"><![CDATA[
Hello,<br><br>I 'm writing a scrable game and I have some problem about strings and lists.<br><br>I have a mysql database where all questions and answers exist. I don't insert the questions myself, so maybe questions have invalid characters such as {, }, [, ].<br><br>The problem is where do I need to use [join], [concat], <ul> <li>commands in order not to have problems.<br><br>A part of my code is the following<br><div class="codebox"><p>Code: </p><pre><code># Comments:#  chid = channel's id from the database#  mysql::sel returns "{Album of John} {Hello world} 1 {Music}"#  gamebot:scrable:translate procedure needs to convert greek characters to englishproc gamebot:scrable:round:new { chid } {    global gamebot gamebot_scrable        # Variables    incr gamebot_scrable(round_$chid) 1        # Read data from the database and creates the variables    set query          "SELECT qhint,qanswer,cid,cname FROM questions,categories WHERE qchid=$chid"    set data            [mysql::sel $gamebot(mysql) $query -flatlist]    set hint            [gamebot:scrable:translate $chid [lindex $data 0]]    set answer          [gamebot:scrable:translate $chid [lindex $data 1]]    set categid         [lindex $data 2]    set categname       [gamebot:scrable:translate $chid [lindex $data 3]]# ERROR OVER HERE :(    #set answer_scrabled [gamebot:scrable_scrablefrase $answer]    set gamebot_scrable(answer_$chid)  $answer    set gamebot_scrable(categid_$chid) $categid    set gamebot_scrable(qstart_$chid)  [clock clicks -milliseconds]    # Creates the binds    bind pubm - * gamebot:scrable_msg    # Send the message to the channel    gamebot:putmsg [gamebot:gettext $chid "SCRABLE_ROUND_NEW" "&lt;round&gt; $gamebot_scrable(round_$chid) &lt;category&gt; $categname &lt;rounds&gt; $gamebot_scrable(rounds_$chid)"]    gamebot:putmsg [gamebot:gettext $chid "SCRABLE_HINT" "&lt;hint&gt; $hint"]    gamebot:putmsg [gamebot:gettext $chid "SCRABLE_ANSWER" "&lt;answer&gt; $answer"]}proc gamebot:scrable:translate { chid args } {    set args [string map {"Ου" "Ou" "Α" "A" "Ά" "A" "Β" "B" "Γ" "G" "Δ" "D" "Ε" "E" "Έ" "E" "Ζ" "Z" "Η" "I" "Ή" "I" "Θ" "Th" "Ι" "I" "Ί" "I" "Κ" "K" "Λ" "L" "Μ" "M" "Ν" "N" "Ξ" "Ks" "Ο" "O" "Ό" "O" "Π" "P" "Ρ" "R" "Σ" "S" "Τ" "T" "Υ" "Y" "Ύ" "Y" "Φ" "F" "Χ" "X" "Ψ" "Ps" "Ω" "O" "Ώ" "O"} $args]    set args [string map {"ου" "ou" "α" "a" "ά" "a" "β" "b" "γ" "g" "δ" "d" "ε" "e" "έ" "e" "ζ" "z" "η" "i" "ή" "i" "θ" "th" "ι" "i" "ί" "i" "κ" "k" "λ" "l" "μ" "m" "ν" "n" "ξ" "ks" "ο" "o" "ό" "o" "π" "p" "ρ" "r" "σ" "s" "ς" "s" "τ" "t" "υ" "y" "ύ" "y" "φ" "f" "χ" "x" "ψ" "ps" "ω" "o" "ώ" "o"} $args]    return $args}proc gamebot:scrable_scrableword { str } {    # Variables    set len [string length $str]    set nstr ""        while {$len &gt; 0} {        set num [format %.0f [expr {rand() * ($len - 1)}]]        append nstr [string index $str $num]        set str [string replace $str $num $num]        incr len -1    }        return $nstr}proc gamebot:scrable_scrablefrase { str } {    # Variables    set words [regexp -all {\s} $str]    set i 0    set nstr ""        while {$i &lt;= $words} {        lappend nstr [gamebot:srable_scrableword [join [lindex [split $str] $i]]]        incr i    }        return [join $nstr]}</code></pre></div>Please help.<br>Thanks</li></ul><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2661">cerberus_gr</a> — Sat Jun 24, 2006 9:11 am</p><hr />
]]></content>
	</entry>
	</feed>
