Don't suppose anyone would be willing to take a mIRC script I wrote and convert it to TCL. I am not familiar enough with TCL and it's syntax to convert it myself.
on *:disconnect: {
if ($network == somenet) savetables
}
on *:unload: {
savetables
}
on *:text:*:#: {
if ($chan == #ourchan) && ($network == somenet) && (($nick isop #ourchan) || ($nick == $me)) {
if ($1 == !trigger1) {
if ($3 == $null) {
hadd temp1 $2 $day $+ , $adate
notice $nick Added $2 $day $+ , $adate to the list
}
if ($3- != $null) {
hadd temp1 $2 $3-
notice $nick Added $2 $3- to the list
}
}
if ($1 == !trigger2) {
hlist temp1
}
if ($1 == !trigger3) && ($2 != $null) {
hdel temp1 $2
notice $nick Removed $2 from the list
}
if ($1 == !trigger4) && ($2 != $null) {
if ($hfind(temp1, $2 $+ ) != $null) {
%date = $gettok( $+ $hget(temp1, $2 $+ ) $+ , 2, 32)
%month = $gettok(%date, 1, 47)
%day = $gettok(%date, 2, 47)
%year = $gettok(%date, 3, 47)
/msg $nick $hfind(temp1, $2 $+ ) has been in the list since $hget(temp1, $2 $+ ) for a total of 3 $duration($calc($ctime - $ctime( $+ %day $+ / $+ %month $+ / $+ %year $+ )))
}
else /msg $nick $2 is not in the table yet.
}
if ($1 == !trigger5) {
/msg $nick !trigger1 <nick> to add a nick to the list. Optionally you could add the user and specify a day and date.
/msg $nick Example: !trigger1 Quasimodo OR !trigger1 Quasimodo Sunday, 11/16/2003
/msg $nick -
/msg $nick !trigger2 to get a list of all the nicks in the list
/msg $nick -
/msg $nick !trigger3 <nick> to remove a nick from the list
/msg $nick Example: !trigger3 Quasimodo
/msg $nick -
/msg $nick !trigger4 <nick> to search the list for a specific nick
/msg $nick Example: !trigger4 Quasimodo
}
if ($1 == !addtemp3) {
hadd temp3 $2-
notice $nick $2- has been added to the temp3 list.
}
if ($1 == !addtemp2) {
hadd temp2 $2-
notice $nick $2- has been added to the temp2 list.
}
if ($1 == !addtemp4) {
hadd temp4 $2-
notice $nick $2- has been added to the temp4 list.
}
if ($1 == !addtemp5) {
hadd temp5 $2-
notice $nick $2- has been added to the temp5 list.
}
if ($1 == !addtemp6) {
hadd temp6 $2-
notice $nick $2- has been added to the temp6 list.
}
if ($1 == !addtemp7) {
hadd temp7 $2-
notice $nick $2- has been added to the temp7 list.
}
}
if ($chan == #ourchan) && ($network == somenet) {
if ($1 == !temp3) {
newlist temp3
}
if ($1 == !temp2) {
newlist temp2
}
if ($1 == !temp4) {
newlist temp4
}
if ($1 == !temp5) {
newlist temp5
}
if ($1 == !temp6) {
newlist temp6
}
if ($1 == !temp7) {
newlist temp7
}
}
}
alias hlist {
if (!$hget($1,0).item) { /msg $nick the table is empty, you need to add servers first. }
else {
%i = 1
while (%i <= $hget($1,0).item) {
%Item = $hget($1,%i).item
%Value = $hget($1,%Item)
%date = $gettok(%Value, 2, 32)
%month = $gettok(%date, 1, 47)
%day = $gettok(%date, 2, 47)
%year = $gettok(%date, 3, 47)
/msg $nick %Item %Value 3 $duration($calc($ctime - $ctime( $+ %day $+ / $+ %month $+ / $+ %year $+ )))
inc %i
}
/msg $nick Listed $hget($1,0).item Items from table. Done!
}
}
alias newlist {
if ($1 == temp3) { /msg $nick Following is the list of temp3 }
elseif ($1 == temp2) { /msg $nick Following is the list of temp2 }
elseif ($1 == temp4) { /msg $nick Following is the list of temp4 }
elseif ($1 == temp5) { /msg $nick Following is the list of temp5 }
elseif ($1 == temp6) { /msg $nick Following is the list of temp6 }
elseif ($1 == temp7) { /msg $nick Following is the list of temp7 }
/msg $nick -------------------------------------------------------------------
if (!$hget($1,0).item) { /msg $nick The list is empty at this time. Please let an op know that we need to add to the list.. }
else {
%i = 1
while (%i <= $hget($1,0).item) {
%Item = $hget($1,%i).item
%Value = $hget($1,%Item)
/msg $nick $+ $rand(2,13) $+ %Item
inc %i
}
}
}
OK, it has everal triggers that do various things. One trigger would add names to a file I guess since I don't know if TCL has anything like mIRC's hash tables. The file would be in the format <nick> <Day>, <US format date> In mIRC I had two options for this command. One was to just trigger the event with the <nick> to add and it would add the current day, date info. The second was to manually include the day and date info and the script would not add it if we already did. Another would remove names, another would list them and another would allow a search of all the names. All these were only for Ops in the channel, not in the bot's userlist. For the list and search it would compare the date saved with the current date and in the results that are /msg'ed to the op it tells how long since the date in the file.
Another group of triggers (6 total) would write to various other files (which I think I know how to do) info on various topics. There is a file for each trigger. Ex: !trigger1 would write it;s info to file named trigger1. Also only accessible to Ops of the channel. These are all in the format <!trigger> <info to add to the file>.
Another group of triggers (also 6 total) accessible by anyone in the channel will /msg the person that triggered the event everything in the files.
And others (again 6) to remove info from the files being added to by the first group of 6 triggers
This may just confuse you more, let me know if I need to try and describe it better