• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Question - Code help? Trying not to do a sub more then once after combat.

Joined
Dec 24, 2017
RedCents
1,813¢
Totally new to coding, but started tinkering around some. I ran into a slight problem. Creating a flag to only go to a sub one after combat reset. This may or may not be the place to post this, but thought I would give it a whirl.


So to even look at the Sub SKnightStuff when in the Sub CombatReset the following has to be true.

Code:
    /if (${BandolierOn}) {
        /if (${Select[${Me.Class.ShortName},SHD]}) /call SKnightstuff
    }


If this statement is true it would do the following Sub:

Code:
| ----------------------------------------------------------------------------
| SUB: SKnightstuff
| ----------------------------------------------------------------------------
    Sub SKnightStuff
        /if (${Me.Class.Name.Equal[Shadow Knight]}) {
            /if (!${Me.Combat}) {
                /if (!${Me.Inventory[13].Name.NotEqual[Invested Honed Wurmslayer]}) {
                    /bandolier activate Deflection
                }
            }
        }
    /return

This basically just puts in a sword and shield by activating a bandolier preset out of combat.

The problem is the check keeps happening over and over again, so if I want to change my primary or secondary to a different set up, I can't. My main question is, due to lack of coding knowledge, is there a way to check this once and not to look at it again until the next combat event has ended.


I was thinking I could set a flag here:

Code:
| ----------------------------------------------------------------------------
| SUB: SKnightstuff
| ----------------------------------------------------------------------------
    Sub SKnightStuff
        /if (${Me.Class.Name.Equal[Shadow Knight]}) {
            /if (!${Me.Combat}) {
                ( X=Off) {
                    /bandolier activate Deflection
                }
            }
        }
    /return

Then when the Sub Combat runs it would turn X = On

Then the new check Sub in CombatReset could would be:

Code:
    /if (${BandolierOn} && X= On) {
        /if (${Select[${Me.Class.ShortName},SHD]}) /call SKnightstuff
    }


I think this makes sense, just not sure how to declare that X or how much would be involved to do something like this.
 
you would have to declare it at the top of the file like :

/declare x int outer 0


| ----------------------------------------------------------------------------
| SUB: SKnightstuff
| ----------------------------------------------------------------------------
Sub SKnightStuff
/if (${Me.Class.Name.Equal[Shadow Knight]}) {
/if (!${Me.Combat} && !${X}) {
/bandolier activate Deflection
/varset X 1
}
}
/return


Then somewhere at the end of where your combat routine exits :

/varset X 0
 
Last edited:
@eclipse2g is pointing you in the correct direction. What you will want to do is create an outer variable in the main sub routine. Lets call it OOCBandOn(/declare OOCBandOn integer outer 0).

Now in the combat routine you need to make sure is gets set to 0(zero). So anywhere in the top of the combat routine, where you turn on /attack that is where you need to /varset OOCBand 0. Now in the SKnightStuff routine you need to set OOCBand on just after the
/bandolier activate Deflection
/varset OOCBand 1

There are a bunch of places you can modify the code to add the check to not use the /bandolier, but the I would just add it here:

Rich (BB code):
    Sub SKnightStuff
        /if (${Me.Class.Name.Equal[Shadow Knight]}) {
            /if (!${Me.Combat} && !${OOCBand}) {
                /if (!${Me.Inventory[13].Name.NotEqual[Invested Honed Wurmslayer]}) {
                    /bandolier activate Deflection
                    /varset OOCBand 1
                }
            }
        }
    /return
 
Question - Code help? Trying not to do a sub more then once after combat.

Users who are viewing this thread

Back
Top
Cart