PussyFoot
New member
- Joined
- Jul 2, 2014
- RedCents
- 744¢
I've been toying with the idea of getting a state engine going in order to really simplify the coding that I am doing. Basically the concept of a state engine is what people used to write code for assembly or microprocessors. It allows you to use a single variable instead of multiple variables in order to keep track of what to do next.
For instance:
State 1 would be 0001 in binary. That of course has a value of 1 in decimal.
State 2 would be 0010 in binary. That has a value of 2.
State 3 would be 0100 in binary. That has a value of 4.
State 4 would be 1000 in binary. Has a value of 8.
So you could then look at a variable, if it was for instance 1, it would contain 0001 so the first bit is set. If it were 3, it would be 0011. So you know that both State 1 and State 2 are active.
Anyway, I find this to be very valuable in coding a bot. Why? Because as I said, you can have multiple states active at the same time.
If State 1 AND state 2, you know you need to do both.. not just one or the other. It also frees you up from having 15000 variables in the main engine.
So for anyone interested in testing out my enchanter driven by a state engine, and this one is far from complete but it gives you a very good idea of how the state engine works and how to speed things up so that the processor is freed up to do other things, here is my generic puller with a state engine driving it. I've included stateengine.inc which would allow any person to use it to make their own event driven character bot.
How to run this macro: /mac stateengine
After the first time you run it you'll want to edit the file it creates mystuff.ini (This works with the mystuff.ini that was created by cdeadhills if you ran that macro before, you won't have to setup your character again you'll just have to add the zones you want.)
This is designed to work with as many zones as you want to set it up for. The examples I am including are for Neriak 4th gate. I have a simple camp set up with 3 pulling paths that it will run through. after it runs a path that has no mobs left, it will proceed to the next. After the last path in your INI it will go back and run the first one again ad naseum.
First you'll want to set up your group. Change the names and macros associated with each one.
For instance, if your tanks name is Bob and he runs kissassist you'll change it to
Next comes some default settings, but you can change them if you want.
NukeAt determines when you start nuking, if you nuke.
NoDebffAt determines the percentage at which you stop debuffing.
DoNuke1-3 determines if you attempt to cast your nukes.
Next come your spells. You'll want to change the rank to the one you have.
Buffs are a little bit more difficult to set up in this test version as I'm working on a new way to maintain item buffs. As time goes I'm going to be adding different flags to allow you to buff others, melee, tank etc.. For now it doesn't do any of that.. but it will maintain your group buffs and your personal clicks.
In this prototype the method is buff1= name of the buff in your buff window. Buff2= what type it is spell, item, AA. Buff3= any data necessary (in the case of items, you would put in the name of the item to click to get that buff.) The way this bot works, is before every state engine iteration he will test one buff to see if it's up. That way he's not spending time going through 15 or 20 buffs before every pull. It seems to work rather well for me. I'm also going to be adding in a routine that on start up he checks all of them.
These under MYBUFFS are your custom item buffs, you'll want to set it to whatever items you want to use, and set a delay on the cast.
This one for instance will tell it to cast the chanter epic 2.0 and to delay 30(3s) after doing so to give it time to cast.
(more to come later.)
Here is the current file that I have going for into the Hills as a Chanter puller. As stated in the other thread it will build a custom INI file for you. You'll also need to download the hillsinto.ini path file. I'll include that. When you run it the first time it will put variables in mystuff.ini (You can change that file name if you want in the main body of the macro.) Edit your team, your ranks etc.
Next version hopefully I'll have it do ranks for you based on your enchanter. Also working on getting it to move the group from point 1 to 2 to 3 to speed things up.
One note, if you have an older version if you change SpinStun in your mystuff.ini to "Empowered Minion" it will keep this pet buff up for you.
Added newest version below, this one "moves" your group. It's very sloppy at the moment but will clean it up later. Let me know how it works for you.
To get this to run you need to change the following value in your mystuff.ini
You need to set up your zone. First thing you do is fine out what zone you are. You can do this by typing /echo ${Zone.ShortName}
In this case Neriak 4th Gate comes out as neriakd
Next you need to create an INI file with the points you want in it. If you need help with this let me know and I'll do a writeup on how to do it. I'm also working on a macro that will record paths for you and clean them up. Still a work in progress.
In this case I've called it neriak.ini
Next you'll want to add entries based on the zone name in your mystuff.ini
CampX and CampY indicate where you want your group to camp. The other is the ini with your paths in it. I've included my neriak.ini so you can look at it and even try it out if you want. You'll just have to find the right spot to camp.
Give it a shot, see what you think, and let me know. I'm also including a 'camp' file for the Sepulcher East camp that GPS_Soldier posted. I ran my chanter here with a bot crew for about 16 hours the other day to test it. (Which brings me to the thought that this bot does not handle unmezzable mobs well at the moment, another routine I'm currently revamping.)
You'll have to added this info to your [MySettings] in mystuff.ini:
*If you find this code handy and want to donate:
PayPal Donate
For instance:
State 1 would be 0001 in binary. That of course has a value of 1 in decimal.
State 2 would be 0010 in binary. That has a value of 2.
State 3 would be 0100 in binary. That has a value of 4.
State 4 would be 1000 in binary. Has a value of 8.
So you could then look at a variable, if it was for instance 1, it would contain 0001 so the first bit is set. If it were 3, it would be 0011. So you know that both State 1 and State 2 are active.
Anyway, I find this to be very valuable in coding a bot. Why? Because as I said, you can have multiple states active at the same time.
If State 1 AND state 2, you know you need to do both.. not just one or the other. It also frees you up from having 15000 variables in the main engine.
So for anyone interested in testing out my enchanter driven by a state engine, and this one is far from complete but it gives you a very good idea of how the state engine works and how to speed things up so that the processor is freed up to do other things, here is my generic puller with a state engine driving it. I've included stateengine.inc which would allow any person to use it to make their own event driven character bot.
How to run this macro: /mac stateengine
After the first time you run it you'll want to edit the file it creates mystuff.ini (This works with the mystuff.ini that was created by cdeadhills if you ran that macro before, you won't have to setup your character again you'll just have to add the zones you want.)
This is designed to work with as many zones as you want to set it up for. The examples I am including are for Neriak 4th gate. I have a simple camp set up with 3 pulling paths that it will run through. after it runs a path that has no mobs left, it will proceed to the next. After the last path in your INI it will go back and run the first one again ad naseum.
First you'll want to set up your group. Change the names and macros associated with each one.
Rich (BB code):
[MySettings]
TankName=TANKNAMEGOESHERE
TankMacro=TANKMACROGOESHERE
LooterName=LOOTERNAMEGOESHERE
LooterMacro=LOOTERMACROGOESHERE
Toon1=TOON1NAMEGOESHERE
Macro1=TOON1MACROGOESHERE
Toon2=TOON2NAMEGOESHERE
Macro2=TOON2MACROGOESHERE
Toon3=TOON3NAMEGOESHERE
Macro3=TOON3MACROGOESHERE
For instance, if your tanks name is Bob and he runs kissassist you'll change it to
Rich (BB code):
TankName=Bob
TankMacro=kissassist
Next comes some default settings, but you can change them if you want.
Rich (BB code):
NukeAt=90
NoNukeAt=20
NoDebuffAt=65
DoNuke1=1
DoNuke2=1
DoNuke3=1
NukeAt determines when you start nuking, if you nuke.
NoDebffAt determines the percentage at which you stop debuffing.
DoNuke1-3 determines if you attempt to cast your nukes.
Next come your spells. You'll want to change the rank to the one you have.
Rich (BB code):
SpellNuke1=Mindcleave Rk. II
SpellNuke2=Phantasmal Assault Rk. II
SpellNuke3=Chromaclash Rk. II
SpellMez=Confound Rk. II
SpellAEMez=Slackening Wave Rk. II
SpellRune=Phantasmal Unity Rk. II
SpellRuneBuff=Polyiridescent Rune Rk. II
SpellDot=Mind Squall Rk. II
SpellStun=Empowered Minion Rk. II
SpellTash=Enunciation of Tashan Rk. II
SpellCripple=Demolished Consciousness Rk. II
SpellAura1=Twincast Aura
SpellAura1Message=Twincast Aura
SpellAura2=Mana Reverberation Aura Rk. II
SpellAura2Message=Mana Rev. Aura Rk. II
Buffs are a little bit more difficult to set up in this test version as I'm working on a new way to maintain item buffs. As time goes I'm going to be adding different flags to allow you to buff others, melee, tank etc.. For now it doesn't do any of that.. but it will maintain your group buffs and your personal clicks.
In this prototype the method is buff1= name of the buff in your buff window. Buff2= what type it is spell, item, AA. Buff3= any data necessary (in the case of items, you would put in the name of the item to click to get that buff.) The way this bot works, is before every state engine iteration he will test one buff to see if it's up. That way he's not spending time going through 15 or 20 buffs before every pull. It seems to work rather well for me. I'm also going to be adding in a routine that on start up he checks all of them.
Rich (BB code):
[BuffList]
Buff1=Hastening of Prokev Rk. II
Buff1Type=Spell
Buff2=Voice of Precognition Rk. II
Buff2Type=Spell
Buff3=Shield of the Pellarus Rk. II
Buff3Type=Spell
Buff4=Aura of the Void
Buff4Type=Item
Buff4Time=10
Buff4Item=Momento of the Ungod's Suffering
Buff5=Illusion: Runic Tattoo Nihil Male
Buff5Type=Item
Buff5Time=40
Buff5Item=Polymorph Wand: Runic Tattoo Nihil - Male
Buff6=Soothing Breath XII
Buff6Type=Item
Buff6Time=20
Buff6Item=Mindbinder's Stud
Buff7=Expanding Mind X
Buff7Type=Item
Buff7Time=20
Buff7Item=Mulch Fiber Belt
Buff8=Myrmidon's Skill VIII
Buff8Type=Item
Buff8Time=20
Buff8Item=shoulder Guards of Alarm
Buff9=Form of Defense XV
Buff9Type=Item
Buff9Time=20
Buff9Item=Raptor Bone Ring
Buff10=Gunthak Grit
Buff10Type=Item
Buff10Time=20
Buff10Item=Gunthak Swabby's Eyepatch
Buff11=Aegis of Abstraction
Buff11Type=Item
Buff11Time=20
Buff11Item=Staff of Eternal Eloquence
Buff12=Gnoll Reaver Fortitude
Buff12Type=Item
Buff12Time=40
Buff12Item=Bloodmetal Inlaid Gnollish Totem
These under MYBUFFS are your custom item buffs, you'll want to set it to whatever items you want to use, and set a delay on the cast.
Rich (BB code):
Buff11=Aegis of Abstraction
Buff11Type=Item
Buff11Time=30
Buff11Item=Staff of Eternal Eloquence
This one for instance will tell it to cast the chanter epic 2.0 and to delay 30(3s) after doing so to give it time to cast.
(more to come later.)
Here is the current file that I have going for into the Hills as a Chanter puller. As stated in the other thread it will build a custom INI file for you. You'll also need to download the hillsinto.ini path file. I'll include that. When you run it the first time it will put variables in mystuff.ini (You can change that file name if you want in the main body of the macro.) Edit your team, your ranks etc.
Next version hopefully I'll have it do ranks for you based on your enchanter. Also working on getting it to move the group from point 1 to 2 to 3 to speed things up.
One note, if you have an older version if you change SpinStun in your mystuff.ini to "Empowered Minion" it will keep this pet buff up for you.
Added newest version below, this one "moves" your group. It's very sloppy at the moment but will clean it up later. Let me know how it works for you.
To get this to run you need to change the following value in your mystuff.ini
You need to set up your zone. First thing you do is fine out what zone you are. You can do this by typing /echo ${Zone.ShortName}
In this case Neriak 4th Gate comes out as neriakd
Next you need to create an INI file with the points you want in it. If you need help with this let me know and I'll do a writeup on how to do it. I'm also working on a macro that will record paths for you and clean them up. Still a work in progress.
In this case I've called it neriak.ini
Next you'll want to add entries based on the zone name in your mystuff.ini
Rich (BB code):
neriakdCampX=750
neriakdCampY=447
neriakd=neriak.ini
CampX and CampY indicate where you want your group to camp. The other is the ini with your paths in it. I've included my neriak.ini so you can look at it and even try it out if you want. You'll just have to find the right spot to camp.
Give it a shot, see what you think, and let me know. I'm also including a 'camp' file for the Sepulcher East camp that GPS_Soldier posted. I ran my chanter here with a bot crew for about 16 hours the other day to test it. (Which brings me to the thought that this bot does not handle unmezzable mobs well at the moment, another routine I'm currently revamping.)
You'll have to added this info to your [MySettings] in mystuff.ini:
Rich (BB code):
eastsepulcher=esep.ini
eastsepulcherCampX=805
eastsepulcherCampY=-1930
*If you find this code handy and want to donate:
PayPal Donate
Attachments
Last edited:

