Ragnarok Script for Dual Client Auto FarmingThis script is for users with advance knowledge:If you don't know what you are doing, kindly see and make this work first:
https://www.blueeye-macro.com/viewtopic.php?f=437&p=198717This script is not perfect, and I do not know what problems you might encounter (do it at your own risk)
Requirements:
-2 clients with 800x600 resolution that will fit horizontally in your screen
-Level 40+ characters, or character that will not easily die in the mobs
CONS:
1. Random Walking is Disabled, you should have teleport skill or unlimited fly wing
2. It will not avoid going to a portal to another map
3. It will attempt kill steal and loot steal
4. Potion use is not fast and reliable.
5. This script does not use keyboard press, it will double click on the fly wing (since keyboard press doesn't work in my case)
6. It will not auto storage the loots, so being overweight is bad unless you have Sky Deleter Card, your character can go up to 90% weight
7. It will click on the GM global chat because the color yellow is the same with the monster to attack. If you want you can change the monster to attack color.
Note:
-When I use this macro, I maxed zoom-in so it will only see nearby monsters, this will be helpful on a map with lots of walls and obstacles.
-Slot 1 is for Potion, Slot 2 is for Fly Wing, Slot 3 is for awakening, Slot 4 is for Potion2, Slot 5 is for Potion3
-If you want to use the teleport skill, you need to add a mouse click or keyboard enter after using the skill.
-I have used it with Knight, Rogue, and Blacksmith and it works fine.
So to make this work: You need to change the spr (Sprite) of all monster you want to attack with the yellow color attached sprite, change the monster you want to avoid to the orange color attached sprite, and changed the item you want to pick-up to the blue color attached sprite using the GRF Editor. (Please see my attached files)
Version 0.2Code:
begin
Window.Rename("Ragnarok", "yes", "Ragnarok1")
Window.Set location("Ragnarok1", "yes", "0", "0")
Window.Rename("Ragnarok", "yes", "Ragnarok2")
Window.Set location("Ragnarok2", "yes", "810", "0")
// Settings
// Change to 0 if you have no awakes or potion
Variable.Set("IsAwakeAvailable", "1")
Variable.Set("R2IsAwakeAvailable", "1")
Variable.Set("IsPotionAvailable", "1")
Variable.Set("R2IsPotionAvailable", "1")
// Potion to use when HP is 2/3
Variable.Set("HowManyPotionToUse", "5")
Variable.Set("HowManyAttackAttempt", "5")
// Coordinates
Variable.Set("ShortCutBarY", "42")
Variable.Set("FlyWingX", "277")
Variable.Set("PotionX", "249")
Variable.Set("Potion2X", "335")
Variable.Set("Potion3X", "365")
Variable.Set("AwakeningX", "307")
// CoordinatesR2
Variable.Set("R2ShortCutBarY", "42")
Variable.Set("R2FlyWingX", "1080")
Variable.Set("R2PotionX", "1051")
Variable.Set("R2Potion2X", "1138")
Variable.Set("R2Potion3X", "1166")
Variable.Set("R2AwakeningX", "1109")
// Start a timer
Macro.Start stopwatch("checkTime")
Macro.Start stopwatch("R2checkTime")
Macro.Start stopwatch("checkAttackTime")
Macro.Start stopwatch("R2checkAttackTime")
// Check Initialize every 5 minutes
Variable.Set("MinutesToCheck", "1860000")
Variable.Set("MinutesToAttack", "10000")
Variable.Set("R2MinutesToAttack", "10000")
// Start Up
Variable.Set("IsWhatClient", "1")
Function.Execute("Initialize")
Variable.Set("IsWhatClient", "2")
Function.Execute("Initialize")
Variable.Set("IsWhatClient", "1")
begin loop()
// Macro.Pause("500")
Function.Execute("MoveClient")
end
end
function("CheckItemTimer")
begin
if Variable.Is equal to("IsWhatClient", "1")
begin
Macro.Read stopwatch("checkTime", "waitTime")
if Variable.Is greater than (Math)("waitTime", "{MinutesToCheck}")
begin
Function.Execute("Initialize")
end
end
if Variable.Is equal to("IsWhatClient", "2")
begin
Macro.Read stopwatch("R2checkTime", "R2waitTime")
if Variable.Is greater than (Math)("R2waitTime", "{MinutesToCheck}")
begin
Function.Execute("Initialize")
end
end
end
function
function("Initialize")
begin
if Variable.Is equal to("IsWhatClient", "1")
begin
if Variable.Is equal to("IsAwakeAvailable", "1")
begin
Color.Limit area of interest to window("Ragnarok1", "yes")
Function.Execute("Awakening")
end
Macro.Restart stopwatch("checkTime")
end
if Variable.Is equal to("IsWhatClient", "2")
begin
if Variable.Is equal to("R2IsAwakeAvailable", "1")
begin
Color.Limit area of interest to window("Ragnarok2", "yes")
Function.Execute("Awakening")
end
Macro.Restart stopwatch("R2checkTime")
end
end
function
function("Awakening")
begin
if Color.Pixel pattern can not be located on screen("203,254,51,-2,-2,203,254,51,1,1,203,254,51,-1,2,203,254,51,1,-1,203,254,51,1,-1,203,254,51,1,-1,203,254,51,0,3,203,254,51,2,0,203,254,51,4,1,203,254,51,-4,0,203,254,51,3,0,203,254,51,-2,0,203,254,51,1,0,203,254,51,-1,-2,203,254,51,1,-1,203,254,51,1,-1,203,254,51,1,-1,203,254,51,0,-1,203,254,51,-1,-1,203,254,51,-1,0,203,254,51,-1,0,203,254,51,-1,1,203,254,51", "10")
begin
if Variable.Is equal to("IsWhatClient", "1")
begin
Mouse.Double click at coordinate("{AwakeningX}", "{ShortCutBarY}", "left")
end
if Variable.Is equal to("IsWhatClient", "2")
begin
Mouse.Double click at coordinate("{R2AwakeningX}", "{R2ShortCutBarY}", "left")
end
end
end
function
function("MoveClient")
begin loop()
// What client to move
if Variable.Is equal to("IsWhatClient", "1")
begin
Function.Execute("CheckItemTimer")
Function.Execute("MoveFirstClient")
end
if Variable.Is equal to("IsWhatClient", "2")
begin
Function.Execute("CheckItemTimer")
Function.Execute("MoveSecondClient")
end
end
function
function("MoveOppositeClient")
begin
// Move Opposite Client
if Variable.Is equal to("IsWhatClient", "1")
begin
Function.Execute("MoveSecondClient")
end
if Variable.Is equal to("IsWhatClient", "2")
begin
Function.Execute("MoveFirstClient")
end
end
function
function("MoveFirstClient")
begin
Color.Limit area of interest to window("Ragnarok1", "yes")
Variable.Set("IsWhatClient", "1")
Function.Execute("CheckItemTimer")
// Humanly.Pause("300","500")
Function.Execute("IfNeedToPotion")
Function.Execute("IsLooting")
Macro.Pause("500")
Function.Execute("IsLooting")
Function.Execute("IsAttacking")
Function.Execute("IsLooting")
Function.Execute("IsFlyWing")
Variable.Set("IsWhatClient", "2")
Color.Limit area of interest to window("Ragnarok2", "yes")
// Macro.Pause("500")
end
function
function("MoveSecondClient")
begin
Humanly.Pause("100", "300")
Color.Limit area of interest to window("Ragnarok2", "yes")
Variable.Set("IsWhatClient", "2")
Function.Execute("CheckItemTimer")
// Humanly.Pause("300","500")
Function.Execute("IfNeedToPotion")
Function.Execute("IsLooting")
Macro.Pause("500")
Function.Execute("IsLooting")
Function.Execute("IsAttacking")
Function.Execute("IsLooting")
Function.Execute("IsFlyWing")
Variable.Set("IsWhatClient", "1")
Color.Limit area of interest to window("Ragnarok1", "yes")
// Macro.Pause("500")
end
function
function("IsLooting")
begin
if Color.Can be located on screen (RGB)("0", "0", "255", "0")
begin
if Variable.Is equal to("IsWhatClient", "1")
begin
Mouse.Click at color closest to coordinate (RGB)("0", "0", "255", "0", "403", "326", "left")
Macro.Break from loop("yes")
Function.Execute("MoveOppositeClient")
end
if Variable.Is equal to("IsWhatClient", "2")
begin
Mouse.Click at color closest to coordinate (RGB)("0", "0", "255", "0", "400", "314", "left")
Macro.Break from loop("yes")
Function.Execute("MoveOppositeClient")
end
end
// Humanly.Pause("300", "500")
end
function
function("IsAttacking")
begin
// Teleport if Monster to avoid is found
Function.Execute("EmergencyFlyWing")
// Check if killing monster is too long, if yes, teleport
if Color.Pixel pattern can be located on screen("255,198,198,0,-1,255,198,198,0,2,255,198,198", "4")
begin
if Variable.Is equal to("IsWhatClient", "1")
begin
Macro.Read stopwatch("checkAttackTime", "waitAttackTime")
if Variable.Is greater than (Math)("waitAttackTime", "{MinutesToAttack}")
begin
Function.Execute("FlyWithoutCondition")
Macro.Restart stopwatch("checkAttackTime")
end
end
if Variable.Is equal to("IsWhatClient", "2")
begin
Macro.Read stopwatch("R2checkAttackTime", "R2waitAttackTime")
if Variable.Is greater than (Math)("R2waitAttackTime", "{R2MinutesToAttack}")
begin
Function.Execute("FlyWithoutCondition")
Macro.Restart stopwatch("R2checkAttackTime")
end
end
end
// If Monster Name is not Visible
if Color.Pixel pattern can not be located on screen("255,198,198,0,-1,255,198,198,0,2,255,198,198", "4")
begin
// Find Monster to Attack
if Color.Can be located on screen (RGB)("255", "255", "0", "0")
begin
// Attack Monster
if Variable.Is equal to("IsWhatClient", "1")
begin
Mouse.Click at color closest to coordinate (RGB)("255", "255", "0", "0", "403", "332", "left")
Mouse.Move to coordinate("800", "0")
end
if Variable.Is equal to("IsWhatClient", "2")
begin
Mouse.Click at color closest to coordinate (RGB)("255", "255", "0", "0", "400", "332", "left")
Mouse.Move to coordinate("800", "0")
end
// Macro.Pause("500")
if Color.Pixel pattern can be located on screen("255,198,198,0,-1,255,198,198,0,2,255,198,198", "4")
begin
if Variable.Is equal to("IsWhatClient", "1")
begin
Macro.Restart stopwatch("checkAttackTime")
Function.Execute("MoveOppositeClient")
end
if Variable.Is equal to("IsWhatClient", "2")
begin
Macro.Restart stopwatch("R2checkAttackTime")
Function.Execute("MoveOppositeClient")
end
Macro.Break from loop("yes")
end
end
end
end
function
function("IsFlyWing")
begin
// Teleport if Monster to avoid is found
Function.Execute("EmergencyFlyWing")
if Color.Can not be located on screen (RGB)("255", "255", "0", "0")
begin
// Second Monster
// if Color.Can not be located on screen (RGB)("250", "69", "0", "0")
// begin
if Color.Can not be located on screen (RGB)("0", "0", "255", "0")
begin
Function.Execute("FlyWithoutCondition")
end
// end
end
end
function
function("FlyWithoutCondition")
begin
if Variable.Is equal to("IsWhatClient", "1")
begin
Function.Execute("IsLooting")
Mouse.Double click at coordinate("{FlyWingX}", "{ShortCutBarY}", "left")
end
if Variable.Is equal to("IsWhatClient", "2")
begin
Function.Execute("IsLooting")
Mouse.Double click at coordinate("{R2FlyWingX}", "{R2ShortCutBarY}", "left")
end
Function.Execute("MoveOppositeClient")
end
function
function("EmergencyFlyWing")
begin
if Color.Can be located on screen (RGB)("255", "181", "82", "0")
begin
Function.Execute("FlyWithoutCondition")
end
end
function
function("IfNeedToPotion")
Begin
// If HP Bar become 2/3
if Variable.Is equal to("IsPotionAvailable","1")
begin
if Variable.Is equal to("IsWhatClient", "1")
begin
if Color.Pixel pattern can be located on screen near coordinate("66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66", "0", "402", "348", "100")
begin
Function.Execute("Potion")
if Color.Pixel pattern can be located on screen near coordinate("66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66", "0", "402", "348", "100")
begin
Function.Execute("Potion2")
if Color.Pixel pattern can be located on screen near coordinate("66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66", "0", "402", "348", "100")
begin
Function.Execute("Potion3")
if Color.Pixel pattern can be located on screen near coordinate("66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66", "0", "402", "348", "100")
begin
Variable.Set("IsPotionAvailable", "0")
end
end
end
end
end
end
if Variable.Is equal to("R2IsPotionAvailable","1")
begin
if Variable.Is equal to("IsWhatClient", "2")
begin
if Color.Pixel pattern can be located on screen near coordinate("66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66", "0", "1225", "347", "100")
begin
Function.Execute("Potion")
if Color.Pixel pattern can be located on screen near coordinate("66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66", "0", "1225", "347", "100")
begin
Function.Execute("Potion2")
if Color.Pixel pattern can be located on screen near coordinate("66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66", "0", "1225", "347", "100")
begin
Function.Execute("Potion3")
if Color.Pixel pattern can be located on screen near coordinate("66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66,3,0,66,66,66", "0", "1225", "347", "1000")
begin
Variable.Set("R2IsPotionAvailable", "0")
end
end
end
end
end
end
end
function
function("Potion")
begin loop("{HowManyPotionToUse}")
// Teleport if Monster to avoid is found
Function.Execute("EmergencyFlyWing")
if Variable.Is equal to("IsWhatClient", "1")
begin
Mouse.Double click at coordinate("{PotionX}", "{ShortCutBarY}", "left")
end
if Variable.Is equal to("IsWhatClient", "2")
begin
Mouse.Double click at coordinate("{R2PotionX}", "{R2ShortCutBarY}", "left")
end
Humanly.Pause("100", "300")
end
function
function("Potion2")
begin loop("{HowManyPotionToUse}")
// Teleport if Monster to avoid is found
Function.Execute("EmergencyFlyWing")
if Variable.Is equal to("IsWhatClient", "1")
begin
Mouse.Double click at coordinate("{Potion2X}", "{ShortCutBarY}", "left")
end
if Variable.Is equal to("IsWhatClient", "2")
begin
Mouse.Double click at coordinate("{R2Potion2X}", "{R2ShortCutBarY}", "left")
end
Humanly.Pause("100", "300")
end
function
function("Potion3")
begin loop("{HowManyPotionToUse}")
// Teleport if Monster to avoid is found
Function.Execute("EmergencyFlyWing")
if Variable.Is equal to("IsWhatClient", "1")
begin
Mouse.Double click at coordinate("{Potion3X}", "{ShortCutBarY}", "left")
end
if Variable.Is equal to("IsWhatClient", "2")
begin
Mouse.Double click at coordinate("{R2Potion3X}", "{R2ShortCutBarY}", "left")
end
Humanly.Pause("100", "300")
end
function
function("NotUsing")
// Second Monster
if Color.Can not be located on screen (RGB)("250", "69", "0", "10")
begin
// Attack Monster
if Variable.Is equal to("IsWhatClient", "1")
begin
Mouse.Click at color closest to coordinate (RGB)("250", "69", "0", "10", "640", "375", "left")
end
if Variable.Is equal to("IsWhatClient", "2")
begin
Mouse.Click at color closest to coordinate (RGB)("250", "69", "0", "10", "1213", "314", "left")
end
// Macro.Pause("300")
if Color.Pixel pattern can be located on screen("255,198,198,0,-1,255,198,198,0,2,255,198,198", "4")
begin
if Variable.Is equal to("IsWhatClient", "1")
begin
Macro.Restart stopwatch("checkAttackTime")
end
if Variable.Is equal to("IsWhatClient", "2")
begin
Macro.Restart stopwatch("R2checkAttackTime")
end
Macro.Break from loop("yes")
end
end
function