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

	<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>2002-05-25T10:13:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-05-25T10:13:00-04:00</updated>

		<published>2002-05-25T10:13:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=7249#p7249</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=7249#p7249"/>
		<title type="html"><![CDATA[can't get this mirc script to work in a tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=7249#p7249"><![CDATA[
Hi<br><br>I am trying to get this mirc script to work with an eggdrop bot.<br><br>Anybody knows how to get it to work?<br><br>on 1:text:*:#:{<br>  if ($1 == ahv) {<br>    if ($2 == calculate) || ($2 == calc) {<br>      if ($3 &gt;= 100) {<br>        if ($4 isnum) { var %Hrs $4 }<br>        else var %Hrs 24<br>        var %StrtGold $3<br>        var %Gold %StrtGold<br>        var %X 0<br>        while (%X &lt; %Hrs) {<br>          var %Gold $int($calc(%Gold * 1.01))<br>          inc %X<br>        }<br>        msg $chan After %Hrs hours in the bank, %StrtGold gold will be %Gold gold.<br>      }<br>      else msg $chan You must have 100 or more gold to earn interest!<br>    }<br>  }<br>}<br><br>My bot's script is setup this way:<br><br>bind pub - ahv pub:ahv <br><br># limit the chans to listen in by filling them in here ( more chans goes this way {#chan1 #chan2} <br>set enabledchans {#ahv2 #nike} <br><br># procedure to check if chan where command is used is listed chan <br>proc isenabledchan { channel } { <br>   global enabledchans <br>   # compare each chan in $enabledchans with current chan and return 1 (true) if chan is listed <br>   foreach enablechan $enabledchans { <br>      if { $channel == $enablechan } { <br>         return 1 <br>      } <br>   } <br>   return 0 <br>} <br><br># main procedure to handle the ahv commands <br>proc pub:ahv { nick uhost handle channel arg } { <br>   # check if command should work in this chan <br>   set chan [string tolower $channel]    <br>   if { ![isenabledchan $chan] } { <br>      return 1 <br>   } <br>   # check if valid command (xp) <br>   if { [llength $arg] == 0 } { <br>      putserv "PRIVMSG $channel :Unable to perform request, give command." <br>   } else { <br>      # get command and compare it to "xp" <br>      set command [lindex $arg 0] <br>      set command [string tolower $command] <br>      if { [string compare $command xp] == 0 } { <br>         # check if valid number of arguments <br>         if { [llength $arg] &lt; 2 } { <br>            putserv "PRIVMSG $channel :Please check the help function if you don't know how to use this command." <br>         # command syntax is ok, process request <br>         } else { <br>            set exp [lindex $arg 1] <br><br>Please can anybody help me to convert the mirc script to tcl with the way it is setup?<br><br>Regards,<br><br>ahv<p>Statistics: Posted by Guest — Sat May 25, 2002 10:13 am</p><hr />
]]></content>
	</entry>
	</feed>
