egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

can't get this mirc script to work in a tcl script

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
ahv
Guest





PostPosted: Sat May 25, 2002 10:13 am    Post subject: Reply with quote

Hi

I am trying to get this mirc script to work with an eggdrop bot.

Anybody knows how to get it to work?

on 1:text:*:#:{
if ($1 == ahv) {
if ($2 == calculate) || ($2 == calc) {
if ($3 >= 100) {
if ($4 isnum) { var %Hrs $4 }
else var %Hrs 24
var %StrtGold $3
var %Gold %StrtGold
var %X 0
while (%X < %Hrs) {
var %Gold $int($calc(%Gold * 1.01))
inc %X
}
msg $chan After %Hrs hours in the bank, %StrtGold gold will be %Gold gold.
}
else msg $chan You must have 100 or more gold to earn interest!
}
}
}

My bot's script is setup this way:

bind pub - ahv pub:ahv

# limit the chans to listen in by filling them in here ( more chans goes this way {#chan1 #chan2}
set enabledchans {#ahv2 #nike}

# procedure to check if chan where command is used is listed chan
proc isenabledchan { channel } {
global enabledchans
# compare each chan in $enabledchans with current chan and return 1 (true) if chan is listed
foreach enablechan $enabledchans {
if { $channel == $enablechan } {
return 1
}
}
return 0
}

# main procedure to handle the ahv commands
proc pub:ahv { nick uhost handle channel arg } {
# check if command should work in this chan
set chan [string tolower $channel]
if { ![isenabledchan $chan] } {
return 1
}
# check if valid command (xp)
if { [llength $arg] == 0 } {
putserv "PRIVMSG $channel :Unable to perform request, give command."
} else {
# get command and compare it to "xp"
set command [lindex $arg 0]
set command [string tolower $command]
if { [string compare $command xp] == 0 } {
# check if valid number of arguments
if { [llength $arg] < 2 } {
putserv "PRIVMSG $channel :Please check the help function if you don't know how to use this command."
# command syntax is ok, process request
} else {
set exp [lindex $arg 1]

Please can anybody help me to convert the mirc script to tcl with the way it is setup?

Regards,

ahv
Back to top
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber