Good evening everyone.
I have noticed that some players do not know how to create simple rotations for their bot. So i have made the following simple guide to help them get started.
Requirements:
Text editor such as Notepad++
Tutorial-empty.cs file in the attachment is a clean file including markups.
Seriously, that's the only things you need. 😇
STEP1:
You need to have a simple rotation in your mind so your bot can execute it. It will ONLY do what you tell it to do, nothing more nothing less.
Keep your rotation simple at start, 2-3 abilities and check if they are working. From that point you can start slowly building more complex rotation to avoid getting errors and to ensure your rotation is running as intended.
My rotation is as follows for enhancement shaman:
1- Cast Stormstrike
Always when possible
2- Cast Earth Shock
Only when i have mana reduction buff from talent
3- Cast Water Shield
Only when i do not have it activated to avoid spam (If the bot keeps casting this ability, it will NEVER reach number 4)
4- Cast Shamanistic Rage
When health is below 70% and mana is below a certain value.
Be aware that the bot will check number 1 first, if it can cast it then it will start checking again from start. if it can always cast it then it will NEVER reach number 2 to 4.
Now that we have our planned rotation ready. We can start putting it into code.
The code will consist of Four main sections
1- Initialization
We wont touch this
2- CombatTick
We will add variables and conditions to be executed during combat
3-OutofCombatTick
Same as 2 but for out of combat
4-MountTick
We wont touch
STEP2:
We will open Tutorial-empty.cs file that you have downloaded with notepad++. You can see line numbers on your left. We will start by replacing //Variables in line 20 for combat rotations and variables with whichever variables you want to use for your class from line 45 to 50.
I will be using shaman so i will need Target, Player, Mana, Health only. If i was a druid or rogue i would need Energy and Points.
Please make sure you remove // and the text in brackets
And you will have this
You can apply the same thing in out of combat section stuff such as buffs heals
STEP3:
Now that we have completed our variables, it is time to set the conditions for bot to follow.
The format will be as follows
if (Condition1 && Condition2)
{
Do 1;
Do 2;
return true;
}
in my case i want to check if my character is NOT casting and cast Stormstrike
if that is true then it should cast Stormstrike.
if (!Player.IsCasting && WoW.CanCast("Stormstrike"))
{
WoW.Cast("Stormstrike");
return true;
}
I have also added the rest of the rotation that i wrote in STEP1
You will see that when i loaded the rotation i got an error in terminal as below
the code excepted } in line 50 so i will open my code on line 50 and check
You can see the red brackets closing here, the bracket in line 17 is open so i must add another bracket to close it
After fixing the above. i also got a second error while loading
You can see that CombatTick() is missing a return value.
Clearly in line 50 it is missing a return false at the end of the tick.
And now after loading the rotation after fixing all your errors you will get the following message
Congratulations on completing your rotation
Notes:-
1- I have fixed the file from errors i had so you won't have them
2- When you want to close WEPW to load new rotation or profile, ALWAYS close the application before the terminal so you don't get errors when logging again.
3- Refer to Combat-API by MrFade
4- I will update this rotation later on to include trinkets, items, weapon enchantments and multiple enemy aoe.
Tutorial.cs Tutorial-Empty.cs