-If you want to use the teleport skill, you need to add a mouse click or keyboard enter after using the skill.
So it's quarantine period and I'm bored, so I would like to share my script to you guys. But first, I would like to give credit to one guided me on this, please see URL below:
https://www.blueeye-macro.com/viewtopic.php?f=437&t=30450Kindly follow his/her tutorial so that it would be easier to know how to make this script work.
Kindly see PROS and CONS if this will work for you.
PROS:
1. It works and I already got 5+ cards in a month
2. It will teleport when monster is not killed within 9-10 seconds
3. It will teleport when you apply an avoid sprite to a monster (Boss or high level mobs)
4. It will use awakening potion every 30 minutes
5. It will use potions, but only when hp bar is red.
6. With a little edit, it will be usable with attacking monster using skills
7. It will teleport when clicking on a monster failed to show its name 5 times.
CONS:
1. Random Walking is Disabled, you should have teleport skill or unlimited fly wing2. 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.2 - April 17, 2020Code:
begin
Window.Set location("Ragnarok", "yes", "0", "0")
// Settings
// Change to 0 if you have no awakes or potion
Variable.Set("IsAwakeAvailable", "1")
Variable.Set("IsPotionAvailable", "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", "270")
Variable.Set("PotionX", "242")
Variable.Set("Potion2X", "328")
Variable.Set("Potion3X", "357")
Variable.Set("AwakeningX", "299")
// Start a timer
Macro.Start stopwatch("checkTime")
Macro.Start stopwatch("checkLootTime")
// Declare Variables
Variable.Set("IsNotValidMonster", "0")
Variable.Add (Math)("IsNotValidMonster", "1")
// Check Initialize every 31 minutes
Variable.Set("MinutesToCheck", "1860000")
Variable.Set("MinutesToLoot", "10000")
// Start Up
Function.Execute("Initialize")
begin loop()
Macro.Read stopwatch("checkTime", "waitTime")
if Variable.Is greater than (Math)("waitTime", "{MinutesToCheck}")
begin
Function.Execute("Initialize")
end
Function.Execute("Attack")
Function.Execute("Loot4")
Function.Execute("Fly")
Function.Execute("IfNeedToPotion")
// Function.Execute("Rwalk")
end
end
function("Initialize")
begin
if Variable.Is equal to("IsAwakeAvailable","1")
begin
Function.Execute("Awakening")
end
Macro.Restart stopwatch("checkTime")
Macro.Pause("500")
end
function
function("Attack")
begin
// Teleport if Monster to avoid is found
Function.Execute("EmergencyFlyWing")
// Click Monster if Located
if Color.Can be located on screen (RGB)("255", "255", "0", "0")
begin
Mouse.Click at color closest to coordinate (RGB)("255", "255", "0", "0", "640", "375", "left")
// 997 43
Mouse.Move to coordinate("270", "40")
// Teleport if clicking on the monster a number of times but still the name isn't shown
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
Variable.Add (Math)("IsNotValidMonster", "1")
Macro.Pause("500")
if Variable.Is greater than (Math)("IsNotValidMonster", "{HowManyAttackAttempt}")
begin
Variable.Set("IsNotValidMonster", "1")
Function.Execute("FlyWithoutCondition")
end
end
// If the monster isn't dead within the set number of seconds it will 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 loop()
Macro.Get parent loop iteration("count")
Variable.Set("x", "{count}")
if Variable.Is equal to("x","30")
begin
Function.Execute("FlyWithoutCondition")
end
Macro.Pause("300")
Function.Execute("IfNeedToPotion")
// Teleport if Monster to avoid is found
Function.Execute("EmergencyFlyWing")
// Mouse.Move to coordinate("270", "40")
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
if Variable.Is greater than (Math)("IsNotValidMonster", "{HowManyAttackAttempt}")
begin
Variable.Set("IsNotValidMonster", "1")
Function.Execute("FlyWithoutCondition")
end
Variable.Set("IsNotValidMonster", "1")
Macro.Pause("300")
Function.Execute("Loot4")
Macro.Break from loop("yes")
end
end
end
end
function
function("Loot4")
begin
// 463, 249, 376, 287
Color.Limit area of interest to coordinates("263", "149", "676", "487")
if Color.Can be located on screen (RGB)("0", "0", "255", "0")
begin loop()
Mouse.Click at color closest to coordinate (RGB)("0", "0", "255", "0", "640", "375", "left")
Humanly.Pause("400", "500")
if Color.Can not be located on screen (RGB)("0", "0", "255", "0")
begin
if Color.Can not be located on screen (RGB)("0", "0", "255", "0")
begin
Color.Unlimit area of interest()
Macro.Break from loop("yes")
end
end
if Color.Pixel pattern can be located on screen("255,239,148,0,-1,255,239,148,0,2,255,239,148", "4")
begin
Macro.Read stopwatch("checkLootTime", "waitLootTime")
if Variable.Is greater than (Math)("waitLootTime", "{MinutesToLoot}")
begin
// Function.Execute("FlyWithoutCondition")
// Window.Display message box("Loot timer up", "yes")
Macro.Restart stopwatch("checkLootTime")
end
end
if Color.Pixel pattern can not be located on screen("255,239,148,0,-1,255,239,148,0,2,255,239,148", "4")
begin
Macro.Restart stopwatch("checkLootTime")
end
end
Color.Unlimit area of interest()
end
function
function("Rwalk")
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
// set variables from random X coordinates on your screen example 100 to 1100
Variable.Set random number("X", "100", "1100")
// set variables from random Y coordinates on your screen example 100 to 620
Variable.Set random number("Y", "100", "620")
Mouse.Click at coordinate("{X}", "{Y}", "left")
Humanly.Pause("750", "1000")
end
end
function
function("Fly")
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
if Color.Can not be located on screen (RGB)("255", "255", "0", "0")
begin
Function.Execute("FlyWithoutCondition")
end
end
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("FlyWithoutCondition")
begin
Mouse.Double click at coordinate("{FlyWingX}","{ShortCutBarY}","left")
Macro.Pause("1000")
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
Mouse.Double click at coordinate("{AwakeningX}", "{ShortCutBarY}", "left")
Macro.Pause("300")
End
end
function
function("IfNeedToPotion")
Begin
// If HP Bar become 2/3
if Variable.Is equal to("IsPotionAvailable","1")
begin
// if Color.Pixel pattern can not be located on screen("16,239,33,-6,0,16,239,33,3,0,16,239,33,6,0,16,239,33,3,0,16,239,33,3,0,16,239,33,3,0,16,239,33,3,0,16,239,33,3,0,16,239,33,3,0,16,239,33,3,0,16,239,33,3,0,16,239,33,3,0,16,239,33", "0")
if Color.Can be located on screen (RGB)("239", "16", "16", "0")
begin
if Color.Can not be located on screen (RGB)("16", "239", "33", "0")
begin
Function.Execute("Potion")
if Color.Can be located on screen (RGB)("239", "16", "16", "0")
begin
if Color.Can not be located on screen (RGB)("16", "239", "33", "0")
begin
Function.Execute("Potion2")
if Color.Can be located on screen (RGB)("239", "16", "16", "0")
begin
if Color.Can not be located on screen (RGB)("16", "239", "33", "0")
begin
Function.Execute("Potion3")
if Color.Can be located on screen (RGB)("239", "16", "16", "0")
begin
if Color.Can not be located on screen (RGB)("16", "239", "33", "0")
begin
Variable.Set("IsPotionAvailable", "0")
end
end
end
end
end
end
end
end
end
End
function
function("Potion")
begin loop("{HowManyPotionToUse}")
// Teleport if Monster to avoid is found
Function.Execute("EmergencyFlyWing")
Mouse.Double click at coordinate("{PotionX}", "{ShortCutBarY}", "left")
Macro.Pause("300")
end
function
function("Potion2")
begin loop("{HowManyPotionToUse}")
// Teleport if Monster to avoid is found
Function.Execute("EmergencyFlyWing")
Mouse.Double click at coordinate("{Potion2X}", "{ShortCutBarY}", "left")
Macro.Pause("300")
end
function
function("Potion3")
begin loop("{HowManyPotionToUse}")
// Teleport if Monster to avoid is found
Function.Execute("EmergencyFlyWing")
Mouse.Double click at coordinate("{Potion3X}", "{ShortCutBarY}", "left")
Macro.Pause("300")
end
function
Please comment if you found any problem, so we all can think of a solution. Thank you.