Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function use_potions()
- {
- function use_potion() {
- if (!parent.next_skill.use_hp)
- parent.next_potion = new Date();
- if (new Date() > parent.next_potion) {
- if (character.hp < character.max_hp * 0.20) use('use_hp');
- else if (character.mp < character.max_mp * 0.20) use('use_mp');
- else if (character.hp < character.max_hp * 0.50) use('use_hp');
- else if (character.mp < character.max_mp - 300) use('use_mp');
- else if (character.hp < character.max_hp - 1400) use('use_hp');
- }
- }
- setInterval(use_potion, 250);
- }
- function grind() {
- function grindIter() {
- if (character.rip || is_moving(character)) return;
- var target = get_targeted_monster();
- if (!target) {
- target = get_nearest_monster({ min_xp: 100, max_att: 200 });
- change_target(target);
- }
- if (target)
- {
- if (!in_attack_range(target))
- move(character.x + (target.x - character.x) / 2, character.y + (target.y - character.y) / 2);
- if (can_attack(target))
- attack(target);
- }
- loot();
- }
- setInterval(grindIter, 250);
- }
- function auto_attack() {
- setInterval(() => {
- var target = get_targeted_monster();
- if (target && can_attack(target))
- attack(target);
- }, 250);
- }
- function auto_follow() {
- setInterval(() => {
- var target = parent.ctarget;
- if (target && !in_attack_range(target))
- move(character.x + (target.x - character.x) / 2, character.y + (target.y - character.y) / 2);
- }, 250);
- }
- function auto_loot() {
- setInterval(() => {
- loot();
- }, 250);
- }
- use_potions();
- if(false) {
- grind();
- }
- else {
- auto_attack();
- //auto_follow();
- auto_loot();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement