Topic: My current TCL Code for those that want it :)

Enjoy, attachment and usage should be obvious :)

Post's attachments

multirpg.tcl 29.19 kb, 116 downloads since 2012-06-28 

You don't have the permssions to download the attachments of this post.

Thumbs up +4 Thumbs down

Re: My current TCL Code for those that want it :)

That's quite a script smile

Re: My current TCL Code for those that want it :)

YAY Finally scripts smile

Thumbs up +1 Thumbs down

Re: My current TCL Code for those that want it :)

i wish it was a mSL Script

Thumbs up Thumbs down

Re: My current TCL Code for those that want it :)

xplo wrote:

i wish it was a mSL Script

might want to check this. I am going to be added stuff as I got along smile

Hide everything that you wish as much as you can. Sooner or later the grass dies and everyone will be able to see the dirt.

Thumbs up +1 Thumbs down

Re: My current TCL Code for those that want it :)

Hum I'm getting an erro on line 12 when I try loading this to xchat, mind explaining?

Thumbs up Thumbs down

Re: My current TCL Code for those that want it :)

Chotaz wrote:

Hum I'm getting an erro on line 12 when I try loading this to xchat, mind explaining?

this is an eggdrop tcl, not suitable for xchat

Thumbs up +1 Thumbs down

Re: My current TCL Code for those that want it :)

My eggdrop gets the exact same error(line 12 on the updated script)

 bad option "path": must be children, code, current, delete, eval, exists, export, forget, import, inscope, origin, parent, qualifiers, tail, or which
    while executing
"namespace path {::tcl::mathop ::tcl::mathfunc}"
    (file "scripts/idlerpg.tcl" line 9)
    invoked from within
"source scripts/idlerpg.tcl"

Thumbs up Thumbs down

Re: My current TCL Code for those that want it :)

nvm, updating to tcl 8.5 fixed my problem smile

Thumbs up Thumbs down

Re: My current TCL Code for those that want it :)

Ok, I've got 3 problems with this script..  and I may have a 4th (assuming I haven't buggered up the code)

1. If the bot is the player with the lowest sum, it will keep wanting to fight itself.. which of course the game won't allow it to do.. and therefore the fights don't happen ever.

2. The bot keeps wanting to deposit 0 gold.. Not a problem of itself, but it sends a message for the deposit, which the game bot has to process.  I'm trying to hunt this one down.

3. It's also hammering the game bot with bets and fights requests (all 5 requests in less than 2 seconds), which I've fixed in my copy of the script.

Possibly..  the variable bankkeep refers to the amount of money that the bot keeps in the bank..  You also need to keep money 'onhand' as without 20g you will not be picked for a tournament.

Thumbs up Thumbs down

Re: My current TCL Code for those that want it :)

Roc-A-Roo wrote:

Ok, I've got 3 problems with this script..  and I may have a 4th (assuming I haven't buggered up the code)

1. If the bot is the player with the lowest sum, it will keep wanting to fight itself.. which of course the game won't allow it to do.. and therefore the fights don't happen ever.

Quick fix in idlereap:dofight:

foreach data [split $httpdata "\n"] {
     set char [lindex $data [lsearch -exact $data "char"]+1]
     if {$char == $idlereap(user)} {continue}                                     <- add this
Roc-A-Roo wrote:

3. It's also hammering the game bot with bets and fights requests (all 5 requests in less than 2 seconds), which I've fixed in my copy of the script.

Try the following changes:

proc idlereap:dobet {{count 1}} {                                                   <- change the 5 to 1
proc idlereap:dofight {{count 1}} {                                                 <- change the 5 to 1

Then comes your loop with some changes, I'll paste it here for others (look for the first lines):

                if {$idlereap(gold) >= $idlereap(bankkeep) && $idlereap(bets) < 5 && $idlereap(level) >= 30} {
                        for {set z 0} {$z < [- 5 $idlereap(bets)]} {incr z} {
                                dotimer [* $z 10] idlereap:dobet
                        }
                        return
                }
                # yes, we could fight level 10+ but still, this is better
                if {$idlereap(fights) < 5 && $idlereap(level) >= 30} {
                        for {set z 0} {$z < [- 5 $idlereap(fights)]} {incr z} {
                                dotimer [* $z 10] idlereap:dofight
                        }
                }
Roc-A-Roo wrote:

Possibly..  the variable bankkeep refers to the amount of money that the bot keeps in the bank..  You also need to keep money 'onhand' as without 20g you will not be picked for a tournament.

No you don't, the code makes sure that you get 20g right before the tournament start, see idlereap:preparetournament and watch your timers smile

Thumbs up Thumbs down

Re: My current TCL Code for those that want it :)

As I mentioned, I will happily admit I'm a noob when it comes to tcl... big_smile

One thing I think the script could do with is moving the upgrade/buy to their own procs.  This would help, in that the upgrade/buy proc can then be called from anywhere in the script, so you can almost program an entire level up..

Level up order should (ideally) be, bet (x5), upgrade items, slay, upgrade items, and only then do the challenge / fight (x5).

As it's programmed at the moment, the only time the game does an item upgrade, is if you withdraw any money from the bank, which to my mind isn't quite right, and doesn't work into the 'ideal' level up routine.

Also the script should know about the unique items (and work towards upgrading any you have got already, whilst you wait for the game to give you more uniques..  Only after you've gone over the individual item sum for all the uniques should the script be doing "upgrade all".. you ideally want the game to give you unique freebies if possible, and not just blindly upgrade past the point of obtaining them.

Thumbs up Thumbs down

Re: My current TCL Code for those that want it :)

Not sure if this one is my editting or not, but if the bot does it's bets, and loses (like ^Velasca^ did on lvl 34, lost 3/4 and ran out of money)..  and it runs out of gold and can't finish the bets.. it sits just there.. 

...completely forgetting to do a monster attack to get gold to finish the bet cycle..

Thumbs up Thumbs down

Re: My current TCL Code for those that want it :)

More stuff.. I had an issue where the my bot didn't have it's primary nickname, and joined channel, because it wasn't the right nickname it didn't login, and the gamebot was rejecting commands..

[6:44:24 pm] <Velasca-48> [17:44] [idlerpg!idlerpg@idlerpg.users.undernet.org] You are not logged in.
07[6:45:10 pm] <Velasca-48> [17:45] Switching back to nick ^Velasca^
[6:45:10 pm] <Velasca-48> [17:45] Can't change nickname on #idlerpg.  Is my nickname banned?

repeated lots..

So I added this little segment of code to the main msgm proc...

    #You are not logged in
    if {[string match "You are not logged in." $args]} {
        idlereap:login
    }   

You might also explicitly set the alignment to the selected alignment when the bot starts.. Brian and others have had to set it manually for the first time, because the script gave tcl timer errors cos the variable align was undefined.

More to follow

Thumbs up Thumbs down

Re: My current TCL Code for those that want it :)

hrmm, have all these bugs/suggestions/ideas been updated/implemented into the new version/release? I would hate to download this script and then have to go through to fix certain bits :\

IRCSpeed Forums
IRCSpeed IRCd standard RR: irc.ircspeed.org - irc.ircspeed.net - irc.ircspeed.com
IRCSpeed IRCd IPv6 RR: irc6.ircspeed.org - ipv6.ircspeed.org

Re: My current TCL Code for those that want it :)

release the new stable tcl please smile

Thumbs up Thumbs down

17 (edited by StoneC0ld 2011-10-04 04:42:11)

Re: My current TCL Code for those that want it :)

Says that usage should be obvious....

Well, as far as I can see, when I start the bot and join it to the channel, it should attempt to login on a 20-second timer...  I assume that is supposed to generate the trigger for it to register its character....

Simply put, my bot is not even so much as attempting to login...

Am I supposed to use some command to get it to register its character and start playing the game?

Edit:  Ermm...  Ok, apparently the bot wasn't counting the channel join during the bot restart as a channel join...  Got the tcl to start working after manually parting and rejoining the bot...

Thumbs up Thumbs down

Re: My current TCL Code for those that want it :)

OUTsider wrote:

Enjoy, attachment and usage should be obvious smile

hey, is this the latest version or what? tongue

Best regards,

MJ

Thumbs up Thumbs down

Re: My current TCL Code for those that want it :)

Latest release version, from here, figure it out yourself how to continue...

Thumbs up +1 Thumbs down

Re: My current TCL Code for those that want it :)

i tried the formula that u have .... is good but the fights ....are manual ....

<Good Stuff !!!

Thumbs up Thumbs down

21 (edited by gnat 2012-01-18 02:39:05)

Re: My current TCL Code for those that want it :)

notes: there's an extra space on line 3 between "set idlereap(bot)" and "multirpg", but i don't think that matters.
when entering user, pass, bot, do "blah" instead of "<blah>"
it does work on undernet, change "multirpg" to "idlerpg" on line 3. 
add the gamebot to your user list on your bot, with flag +f
thank you OUTsider

Thumbs up Thumbs down

Re: My current TCL Code for those that want it :)

How is this related to idlerpg?

Thumbs up Thumbs down

Re: My current TCL Code for those that want it :)

lueshi wrote:

How is this related to idlerpg?

It's a rewrite of the original code-base created by jotun, for IdleRPG. This has totally removed the 'Idle' factor, meaning you have to actively play in order to advance. This is a very addictive game, so please play using caution and strategy, otherwise you may find yourself down the rabbit hole with a low itemsum tongue

IRCSpeed Forums
IRCSpeed IRCd standard RR: irc.ircspeed.org - irc.ircspeed.net - irc.ircspeed.com
IRCSpeed IRCd IPv6 RR: irc6.ircspeed.org - ipv6.ircspeed.org

24 (edited by istok 2012-11-15 15:55:12)

Re: My current TCL Code for those that want it :)

I had an error with this script recently.

list element in braces followed by "!~casper_br@Swift-D2" instead of space
      while executing
 "lsearch -exact $data "char""
     (procedure "idlereap:dobet" line 7)
     invoked from within
 "idlereap:dobet [- 5 $idlereap(bets)]"
     (procedure "idlereap:msgm" line 173)
     invoked from within
 "idlereap:msgm $_msgm1 $_msgm2 $_msgm3 $_msgm4"

This problem was caused by incorrect use of list functions on string, it was OK until somebody used the nick {Casper} ie. incorporated list characters (braces) in the string *which was the error eggdrop threw up, the above error was the trace*.

Due to the error, and a few other issues, the current version of OUTsider's script that I use is now rewritten.
The following is an amended list of things done.

# rewrote idlereap:dofight for same reason
# uses same syntax with same webpage source

# many other code warnings and 'iffy' syntax NOT yet dealt with
# 1/ dubious use of args special case procedure argument
# 2/ overwriting procedure arguments
# 3/ lack of default case branch on switch statements
# 4/ use of list functions on strings (this may turn out to be a crucial issue)
# 5/ lack of curly braces on expr statement to prevent double substitution and/or performance degradation
# 6/ lack of return statements from procs
# 7/ unnecessary use of expr within if statements (nesting of expr within expression)

# other notes
# 1/ ::tcl::mathop namespace probably not absolutely necessary but would need some rewrite
# 2/ can't see how some procs could possibly work eg. idlereap:pubm:attackstats (assuming channel text is as per example given)
# 3/ adding public command for !bestbet - open for user trigger.

# rewrote idlereap:notc which was the only clearly defined syntax error
# special case args procedure argument was followed by another argument
# if args is used correctly then it must be the last argument
# seems to be evidence that the author was using args incorrectly throughout this script
IRCSpeed Forums
IRCSpeed IRCd standard RR: irc.ircspeed.org - irc.ircspeed.net - irc.ircspeed.com
IRCSpeed IRCd IPv6 RR: irc6.ircspeed.org - ipv6.ircspeed.org

Re: My current TCL Code for those that want it :)

edited.  Hey all.  I found some errors recently.

We'll start with a couple alignment issues.

First is in   proc idlereap:msgm

        set align [lindex $args [lsearch -exact $args "align"]+1]
        switch -- $align {
            "g" { set idlereap(align) "priest" }
            "n" { set idlereap(align) "human" }
            "u" { set idlereap(align) "undead" }
        }

The "u" should be an "e".   rawstats2 and rawplayers3.php use e for evil, even though it's referred to as undead on the website.

--------------------------------------------------------------------------------------------

The second alignment issue is in    proc idlereap:dofight

    if {$victim != ""} {
        dccbroadcast "Fighting $victim \[L$vlevel:S$lowest:A$valign\]"
        if {$valign == "u"} {
            idlereap:align human
        } elseif {$valign == "g"} {
            idlereap:align undead
        } else {
            idlereap:align priest
        }

Same deal, the u should be an e in the line...            if {$valign == "u"} {     
The if then statement is looking at your fight opponent and deciding how to align based on their alignment.
You might want to go ahead and change them to align priest.

---------------------------------------------------------------------------------------------

Third issue is in    proc idlereap:msgm

                    if {$icost_upg < $icost_buy && $idlereap(gold) >= $icost_buy} {
                        set imaxbuy [expr round($imaxbuy)]
                        idlereap:send "BUY $item $imaxbuy"
                        set idlereap(item,$item) $imaxbuy
                        incr idlereap(gold) -$icost_buy
                        set bought 1
                    }

The bot kept buying items that would have been cheaper to upgrade.  The first "<" should be a ">"
However, after changing it I noticed that if it's buying several items at one time, the first item will be a good buy, but the others are not.  Also it would give an integer error.

----------------------------------------------------------------------------------------------

In OUTsider's response to Roc-A-Roo's post, he provided a fix in idlereap:dofight:    (in case you're on a network where it doesn't allow all the fights or bets to be processed at once)

If you're using that fix you'll want to add a rawstats2 timer at the bottom, otherwise you will fight once after the level up routine, then it will take till next creep attack to fight again.

proc idlereap:dofight
        dccbroadcast "No victim found to fight!"
    }
    dotimer 30 "idlereap:align"
    dotimer 60 "idlereap:send RAWSTATS2"
    return 0
}

The timer for rawstats2 is what you would need to add.

------------------------------------------------------------------------------------------------

Good luck!

Thumbs up +3 Thumbs down