This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

mIRC script to TCL

Old posts that have not been replied to for several years.
Locked
m
mdixon4az
Voice
Posts: 13
Joined: Sun Oct 12, 2003 12:12 pm

mIRC script to TCL

Post by mdixon4az »

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.

Thanks
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

can't convert what can't be seen......... :-?
m
mdixon4az
Voice
Posts: 13
Joined: Sun Oct 12, 2003 12:12 pm

Post by mdixon4az »

is there a TCL equal for a hash table? I use like 5 tables in this script
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

copy your mIRC script here..
m
mdixon4az
Voice
Posts: 13
Joined: Sun Oct 12, 2003 12:12 pm

Post by mdixon4az »

on *:start: {
if (!$hget(temp1)) hmake temp1 100
if (!$hget(temp2)) hmake temp2 100
if (!$hget(temp3)) hmake temp3 100
if (!$hget(temp4)) hmake temp4 100
if (!$hget(temp5)) hmake temp5 100
if (!$hget(temp6)) hmake temp6 100
if (!$hget(temp7)) hmake temp7 100
if ($exists(" $+ $scriptdir $+ temp1") == $true) {
hload temp1 " $+ $scriptdir $+ temp1"
}
if ($exists(" $+ $scriptdir $+ temp2") == $true) {
hload -n temp2 " $+ $scriptdir $+ temp2"
}
if ($exists(" $+ $scriptdir $+ temp3") == $true) {
hload -n temp3 " $+ $scriptdir $+ temp3"
}
if ($exists(" $+ $scriptdir $+ temp3") == $true) {
hload -n temp3 " $+ $scriptdir $+ temp3"
}
if ($exists(" $+ $scriptdir $+ temp5") == $true) {
hload -n temp5 " $+ $scriptdir $+ temp5"
}
if ($exists(" $+ $scriptdir $+ temp6") == $true) {
hload -n temp6 " $+ $scriptdir $+ temp6"
}
if ($exists(" $+ $scriptdir $+ temp6") == $true) {
hload -n temp6 " $+ $scriptdir $+ temp6"
}
if ($exists(" $+ $scriptdir $+ temp7") == $true) {
hload -n temp7 " $+ $scriptdir $+ temp7"
}
}

on *:exit: {
savetables
}

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 savetables {
if ($hget(temp1) != $null) hsave -o temp1 " $+ $scriptdir $+ temp1"
if ($hget(temp3) != $null) hsave -o temp3 " $+ $scriptdir $+ temp3"
if ($hget(temp2) != $null) hsave -o temp2 " $+ $scriptdir $+ temp2"
if ($hget(temp4) != $null) hsave -o temp4 " $+ $scriptdir $+ temp4"
if ($hget(temp5) != $null) hsave -o temp5 " $+ $scriptdir $+ temp5"
if ($hget(temp6) != $null) hsave -o temp6 " $+ $scriptdir $+ temp6"
if ($hget(temp7) != $null) hsave -o temp7 " $+ $scriptdir $+ 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
}
}
}
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

omg, i told its not so long..
m
mdixon4az
Voice
Posts: 13
Joined: Sun Oct 12, 2003 12:12 pm

Post by mdixon4az »

can you convert it?
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

nop, i told i could make similar script, but this is to long ahh :roll:
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

How about describing what the script does for those of us that don't know mirc scripting?
Have you ever read "The Manual"?
User avatar
Moose
Voice
Posts: 37
Joined: Mon Aug 18, 2003 2:54 am
Location: Northamption, UK
Contact:

:P

Post by Moose »

please gibe us the idea on what the script does becase we cant help if e dont know what u trying to do? :roll:
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

We wouldn't bother reading the script to convert it since its long.

instead just give us a description on what the script does.
m
mdixon4az
Voice
Posts: 13
Joined: Sun Oct 12, 2003 12:12 pm

Post by mdixon4az »

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
s
spyda
Halfop
Posts: 64
Joined: Mon Aug 12, 2002 2:22 am
Location: Australia

I might be able to help.

Post by spyda »

Email me a copy of the full script.. I will give it a try.
Done some conversons for my mates before :)

asustek@optusnet.com.au
------------
ThePope
Locked