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

	<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-04-16T13:15:27-04:00</updated>

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

		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-04-16T13:15:27-04:00</updated>

		<published>2007-04-16T13:15:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72095#p72095</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72095#p72095"/>
		<title type="html"><![CDATA[adding another arg to existing script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72095#p72095"><![CDATA[
It would also be helpful if you posted a *summary* of what you tried, and what exactly you're trying to test, rather than the entire script, as it's very difficult to see any changes the way you posted.   I'm not inclined to save both copies just to 'diff' them to figure out what is different. There's also function calls (such as set check [war_charfilter $arg] ) but you didn't post those functions so it's impossible to tell what is being done..  <br><br>So, tell us what the content of $args is, and what you're trying to add as a new arg, and what you want as a new test.<br><br>In general, you need to use lindex to split $arg into new vars.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Mon Apr 16, 2007 1:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-04-16T05:45:04-04:00</updated>

		<published>2007-04-16T05:45:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72088#p72088</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72088#p72088"/>
		<title type="html"><![CDATA[adding another arg to existing script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72088#p72088"><![CDATA[
Without knowing how "war_getinfos" is written, it would be pretty hard to know how to help you with your request.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Apr 16, 2007 5:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[jonathan3061]]></name></author>
		<updated>2007-04-16T03:55:17-04:00</updated>

		<published>2007-04-16T03:55:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72085#p72085</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72085#p72085"/>
		<title type="html"><![CDATA[adding another arg to existing script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72085#p72085"><![CDATA[
anyone  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_question.gif" width="15" height="15" alt=":?:" title="Question"> <br><br> <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=8901">jonathan3061</a> — Mon Apr 16, 2007 3:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[jonathan3061]]></name></author>
		<updated>2007-04-10T13:26:22-04:00</updated>

		<published>2007-04-10T13:26:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71986#p71986</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71986#p71986"/>
		<title type="html"><![CDATA[adding another arg to existing script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71986#p71986"><![CDATA[
i currently have this piece of script:<br><div class="codebox"><p>Code: </p><pre><code>proc war_addmatch {nick uhost handle channel arg} {  global war_privchan war_counter war_authsys botnick war_playernumber war_trigger  set channel [string tolower $channel]  if {$channel==$war_privchan} {    if {(![matchattr $handle V])&amp;&amp;($war_authsys==1)} {      putserv "NOTICE $nick :5You are not authed, use /msg $botnick [string trim $war_trigger]admin &lt;password&gt;"      return 0    }    set check [war_charfilter $arg]    if {$check!=1} {      putserv "NOTICE $nick :5Invalid character: \"$check\". Please do not use such character in any field."      return 0    }    if {([lsearch $arg "team(*"]==-1)||([lsearch $arg "date(*"]==-1)||([lsearch $arg "map(*"]==-1)} {      putserv "NOTICE $nick :5Invalid args, you need to enter at least the team(x), date(hh:mm-dd/mm/yy) and map(x) ( + info(x) or number(x) )"      return 0    }    set startindex [lsearch $arg "date(*"]    set buf [lrange $arg $startindex end]    set infos [string range $buf 5 [expr [string first ")" $buf]-1]]    set errormsg [war_checkdate $infos]    if {$errormsg!=1} {      putserv "NOTICE $nick :$errormsg"      return 0    }    set infos [clock scan "[string range $infos 12 13][string range $infos 9 10][string range $infos 6 7] [string range $infos 0 1][string range $infos 3 4]00"]    set infos [linsert $infos 0 $war_counter]    set startindex [lsearch $arg "team(*"]    set buf [lrange $arg $startindex end]    set team [string range $buf 5 [expr [string first ")" $buf]-1]]    set startindex [lsearch $arg "map(*"]    set buf [lrange $arg $startindex end]    set map [string range $buf 4 [expr [string first ")" $buf]-1]]    set info "nothing"    if {[lsearch $arg "info(*"]&gt;-1} {      set startindex [lsearch $arg "info(*"]      set buf [lrange $arg $startindex end]      set info [string range $buf 5 [expr [string first ")" $buf]-1]]    }    set number $war_playernumber    if {[lsearch $arg "number(*"]&gt;-1} {      set startindex [lsearch $arg "number(*"]      set buf [lrange $arg $startindex end]      set number [string range $buf 7 [expr [string first ")" $buf]-1]]    }    set infos [linsert $infos end $team "n/a" "n/a" $map "n/a" $info $number]    war_insertion $infos    war_savefiles    set infos [war_getinfos $war_counter 2]    incr war_counter    set id [lindex $infos 0]    set hour [lindex $infos 1]    set date [lindex $infos 2]    set team [lindex $infos 3]    set maps [lindex $infos 6]    set info [lindex $infos 8]    set number [lindex $infos 9]    if {$number==$war_playernumber} {      putserv "PRIVMSG $channel : 5New war on $date at $hour against $team . Maps: $maps . Infos: $info ( ID $id )"    } else {      putserv "PRIVMSG $channel : 5New war on $date at $hour against $team . Maps: $maps . Infos: $info . Player number: $number . ( ID $id )"    }    war_automanagement  }}</code></pre></div>and i'm trying to add in another $arg , I want it to work the same as $info but I can't get it to work :s. I don't know much of TCL scripting... this is what i've tried so far:<div class="codebox"><p>Code: </p><pre><code>proc war_addmatch {nick uhost handle channel arg} {  global war_privchan war_counter war_authsys botnick war_playernumber war_trigger  set channel [string tolower $channel]  if {$channel==$war_privchan} {    if {(![matchattr $handle V])&amp;&amp;($war_authsys==1)} {      putserv "NOTICE $nick :5You are not authed, use /msg $botnick [string trim $war_trigger]admin &lt;password&gt;"      return 0    }    set check [war_charfilter $arg]    if {$check!=1} {      putserv "NOTICE $nick :5Invalid character: \"$check\". Please do not use such character in any field."      return 0    }    if {([lsearch $arg "team(*"]==-1)||([lsearch $arg "date(*"]==-1)||([lsearch $arg "map(*"]==-1)} {      putserv "NOTICE $nick :5Invalid args, you need to enter at least the team(x), date(hh:mm-dd/mm/yy) and map(x) ( + info(x) or number(x) )"      return 0    }    set startindex [lsearch $arg "date(*"]    set buf [lrange $arg $startindex end]    set infos [string range $buf 5 [expr [string first ")" $buf]-1]]    set errormsg [war_checkdate $infos]    if {$errormsg!=1} {      putserv "NOTICE $nick :$errormsg"      return 0    }    set infos [clock scan "[string range $infos 12 13][string range $infos 9 10][string range $infos 6 7] [string range $infos 0 1][string range $infos 3 4]00"]    set infos [linsert $infos 0 $war_counter]    set startindex [lsearch $arg "team(*"]    set buf [lrange $arg $startindex end]    set team [string range $buf 5 [expr [string first ")" $buf]-1]]    set startindex [lsearch $arg "map(*"]    set buf [lrange $arg $startindex end]    set map [string range $buf 4 [expr [string first ")" $buf]-1]]    set info "nothing"    if {[lsearch $arg "info(*"]&gt;-1} {      set startindex [lsearch $arg "info(*"]      set buf [lrange $arg $startindex end]      set info [string range $buf 5 [expr [string first ")" $buf]-1]]    }    set number $war_playernumber    if {[lsearch $arg "number(*"]&gt;-1} {      set startindex [lsearch $arg "number(*"]      set buf [lrange $arg $startindex end]      set number [string range $buf 7 [expr [string first ")" $buf]-1]]    }    set type "pcw"    if {[lsearch $arg "type(*"]&gt;-1} {      set startindex [lsearch $arg "type(*"]      set buf [lrange $arg $startindex end]      set type [string range $buf 5 [expr [string first ")" $buf]-1]]    }    set infos [linsert $infos end $team "n/a" "n/a" $map "n/a" $info $number $type]    war_insertion $infos    war_savefiles    set infos [war_getinfos $war_counter 2]    incr war_counter    set id [lindex $infos 0]    set hour [lindex $infos 1]    set date [lindex $infos 2]    set team [lindex $infos 3]    set maps [lindex $infos 6]    set info [lindex $infos 8]    set number [lindex $infos 9]    set type [lindex $infos 10]    if {$number==$war_playernumber} {      putserv "PRIVMSG $channel : 5New $type on $date at $hour against $team . Maps: $maps . Infos: $info ( ID $id )"    } else {      putserv "PRIVMSG $channel : 5New $type on $date at $hour against $team . Maps: $maps . Infos: $info . Player number: $number . ( ID $id )"    }    war_automanagement  }}</code></pre></div>Can anybody please push me in the right direction and explain me what i'm doing wrong? <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=8901">jonathan3061</a> — Tue Apr 10, 2007 1:26 pm</p><hr />
]]></content>
	</entry>
	</feed>
