For those of you who just want to see the code for the bot.
Code:
begin
Color.Limit area of interest to window("Soma Mythological Biography", "Yes")
// Set Top left and bottom right coords of the area we want the bot to stay inside
// check SomaInfo file for cords fo hunting areas
Variable.Set("LeftX", "17")
Variable.Set("RightX", "36")
Variable.Set("TopY", "227")
Variable.Set("BottomY", "254")
// Move or not when attacking(Hold shift). {<end>} = no {<lshiftkey>} = yes
Variable.Set("BowMode", "{<end>}")
// Daylight RGB Mobs
Variable.Set("DRed", "165")
Variable.Set("DGreen", "73")
Variable.Set("DBlue", "165")
// VoD RGB Mobs
Variable.Set("NRed", "82")
Variable.Set("NGreen", "32")
Variable.Set("NBlue", "82")
Variable.Set("PixelSearchDistance", "350")
// Stops bot wandering too far to pickup drops(Like other ppls drops)
Variable.Set("NearPixelSearchDistance", "230")
// How much pause there is between movement clicks. Lower seems better for huminisation
Variable.Set("MovePause", "0")
// Presetting some require variables
Variable.Set("Pause", "0")
Variable.Set("PixelRange", "0")
Function.Execute("CalculateNavMarker")
// activates other macros. You have to deactivate these manually even when you stop this macro
Macro.Execute new("Myth of Soma", "Aura Caster (Simba Bot)", "no")
Macro.Execute new("Myth of Soma", "HP&Stamina (Windowed) (Memory) (Simba Bot)", "no")
Macro.Execute new("Myth of Soma", "Bow Changer (Simba Bot)", "no")
end
begin loop()
Color.Limit area of interest to window("Soma Mythological Biography", "Yes")
// Get current coords from memory
Memory.Get value("SomaWindow", "00536788", "4", "CharCoordsY")
Memory.Get value("SomaWindow", "00536784", "4", "CharCoordsX")
// Prevents the bot becoming stuck and needing the user to move the mouse
// Window.Calculate absolute coordinates("Soma Mythological Biography", "yes", "400", "300", "CharX", "CharY")
// Mouse.Set coordinate("{CharX}", "{CharY}")
Macro.Pause("4")
Variable.Set("Status", "Idle")
Variable.Set("Pause", "0")
Variable.Set("VoDMobClose","0")
// Revive on death, warp and abort macro
if Color.Pixel pattern can be located on screen("99,109,82,1,0,41,65,49,1,0,0,0,0,1,0,0,0,0,1,0,148,162,123,1,0,165,174,140,1,0,41,65,49,1,0,0,0,0,1,0,33,52,41,1,0,173,178,148,1,0,24,36,24,1,0,0,0,0,1,0,99,113,99,1,0,148,162,123,1,0,16,24,16", "0")
begin
Macro.Pause("3000")
Mouse.Click at coordinate("466", "728", "Left")
Macro.Pause("1200")
Keyboard.Press key("{<f1>}")
Macro.Abort()
end
// Check for drops
if Color.Near coordinate is (RGB)("0", "255", "255", "400", "300", "{NearPixelSearchDistance}")
begin
Variable.Set("Pause", "0")
Variable.Set("Status", "CollectingDrops")
Mouse.Click at color closest to coordinate (RGB)("0", "255", "255", "{PixelRange}", "400", "300", "Left")
Macro.Pause("100")
end
// Find and attack mob on screen
if Variable.Is equal to("Pause", "0")
begin
if Color.Near coordinate is (RGB)("{DRed}", "{DGreen}", "{DBlue}", "400", "300", "{PixelSearchDistance}")
begin
// save mob coords
Variable.Set("VoDMobClose", "1")
Color.Find coordinate of occurrence on screen closest to coordinate (RGB)("{DRed}", "{DGreen}", "{DBlue}", "{PixelRange}", "400", "300", "MobX", "MobY")
// if other chars are NOT located within range of mob then attack
if Color.Near coordinate is not (RGB)("239", "28", "33", "{MobX}", "{MobY}", "100")
begin
Variable.Set("Status", "Attacking")
Keyboard.Hold keys("{BowMode}")
Mouse.Click at color closest to coordinate (RGB)("{DRed}", "{DGreen}", "{DBlue}", "{PixelRange}", "400", "300", "Left")
if Color.Near coordinate is (RGB)("{DRed}", "{DGreen}", "{DBlue}", "400", "300", "100")
begin
Mouse.Click at color closest to coordinate (RGB)("{DRed}", "{DGreen}", "{DBlue}", "{PixelRange}", "400", "300", "Left")
Mouse.Hold button("Left")
end
if Color.Near coordinate is not (RGB)("{DRed}", "{DGreen}", "{DBlue}", "400", "300", "100")
begin
Mouse.Release button("Left")
end
Keyboard.Release keys("{BowMode}")
end
end
end
// Find and attack mob on screen in VoD dark
if Variable.Is equal to("Pause", "0")
begin
if Variable.Is equal to("VoDMobClose", "0")
begin
if Color.Near coordinate is (RGB)("{NRed}", "{NGreen}", "{NBlue}", "400", "300", "{PixelSearchDistance}")
begin
// save mob coords
Color.Find coordinate of occurrence on screen closest to coordinate (RGB)("{NRed}", "{NGreen}", "{NBlue}", "{PixelRange}", "400", "300", "MobX", "MobY")
// if other chars are NOT located within range of mob then attack
if Color.Near coordinate is not (RGB)("239", "28", "33", "{MobX}", "{MobY}", "100")
begin
Variable.Set("Status", "Attacking")
Keyboard.Hold keys("{BowMode}")
Mouse.Click at color closest to coordinate (RGB)("{NRed}", "{NGreen}", "{NBlue}", "{PixelRange}", "400", "300", "Left")
Keyboard.Release keys("{BowMode}")
end
end
end
end
if Variable.Is equal to("Pause", "0")
begin
// If not attacking or collecting drops, then designate a random coordinate in target area
if Variable.Is equal to("Status", "Idle")
begin
Variable.Calculate difference (Math)("RandomX", "CharCoordsX", "DistanceAwayX")
Variable.Calculate difference (Math)("RandomY", "CharCoordsY", "DistanceAwayY")
Variable.Evaluate (Math)("{DistanceAwayX}+{DistanceAwayY}", "TotalDistance")
Function.Execute("RandomCoord")
if Variable.Is less than (Math)("TotalDistance", "10")
begin
Function.Execute("CalculateNavMarker")
end
if Variable.Is greater than (Math)("DistanceAwayY", "{DistanceAwayX}")
begin
// Move Up
if Variable.Is less than (Math)("RandomY", "{CharCoordsY}")
begin
Window.Calculate absolute coordinates("Soma Mythological Biography", "yes", "{HumanMovementX}", "100", "MoveUpX", "MoveUpY")
Mouse.Click at coordinate("{MoveUpX}", "{MoveUpY}", "Left")
Macro.Pause("{MovePause}")
end
// Move Down
if Variable.Is greater than (Math)("RandomY", "{CharCoordsY}")
begin
Window.Calculate absolute coordinates("Soma Mythological Biography", "yes", "{HumanMovementX}", "500", "MoveDownX", "MoveDownY")
Mouse.Click at coordinate("{MoveDownX}", "{MoveDownY}", "Left")
Macro.Pause("{MovePause}")
end
end
if Variable.Is greater than (Math)("DistanceAwayX", "{DistanceAwayY}")
begin
// Move Left
if Variable.Is less than (Math)("RandomX", "{CharCoordsX}")
begin
Window.Calculate absolute coordinates("Soma Mythological Biography", "yes", "100", "{HumanMovementY}", "MoveLeftX", "MoveLeftY")
Mouse.Click at coordinate("{MoveLeftX}", "{MoveLeftY}", "Left")
Macro.Pause("{MovePause}")
end
// Move right
if Variable.Is greater than (Math)("RandomX", "{CharCoordsX}")
begin
Window.Calculate absolute coordinates("Soma Mythological Biography", "yes", "700", "{HumanMovementY}", "MoveRightX", "MoveRightY")
Mouse.Click at coordinate("{MoveRightX}", "{MoveRightY}", "Left")
Macro.Pause("{MovePause}")
end
end
// In case both equal the same. Stops the bot from getting stuck
if Variable.Is equal to("DistanceAwayX", "{DistanceAwayY}")
begin
Variable.Set random number("RandomClickX", "175", "425")
Variable.Set random number("RandomClickY", "175", "425")
Window.Calculate absolute coordinates("Soma Mythological Biography", "yes", "{RandomClickX}", "{RandomClickY}", "RandomMoveX", "RandomMoveY")
Mouse.Click at coordinate("{RandomMoveX}", "{RandomMoveY}", "Left")
Macro.Pause("{MovePause}")
end
end
end
end
function("CalculateNavMarker")
begin
// random number between the length and width of the coords we want to hunt in. This sets a marker for the char to travel to within our hunting area
Variable.Set random number("RandomX", "{LeftX}", "{RightX}")
Variable.Set random number("RandomY", "{TopY}", "{BottomY}")
Variable.Calculate difference (Math)("RandomX", "CharCoordsX", "DistanceAwayX")
Variable.Calculate difference (Math)("RandomY", "CharCoordsY", "DistanceAwayY")
Variable.Evaluate (Math)("{DistanceAwayX}+{DistanceAwayY}", "TotalDistance")
if Variable.Is less than (Math)("TotalDistance", "10")
begin
Function.Execute("CalculateNavMarker")
end
end
function
function("RandomCoord")
begin
// Adds variation to the area we click on the screen so that we do not run in direct right angles
Variable.Set random number("HumanMovementY", "200", "400")
Variable.Set random number("HumanMovementX", "300", "500")
end
function