From 40d8cf7526aa2071e6000604f577389e045a3b6d Mon Sep 17 00:00:00 2001 From: Kaan Soral Date: Mon, 20 Feb 2017 14:10:37 +0300 Subject: [PATCH] Create buy_potions.js --- examples/buy_potions.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 examples/buy_potions.js diff --git a/examples/buy_potions.js b/examples/buy_potions.js new file mode 100644 index 0000000..beb6130 --- /dev/null +++ b/examples/buy_potions.js @@ -0,0 +1,13 @@ +function buy_potions() +{ + var x=character.real_x,y=character.real_y,map=character.map; + smart_move({to:"potions"},function(done){ + buy("hpot0",100); + buy("mpot0",400); + game_log("Got the potions!","#4CE0CC"); + smart_move({x:x,y:y,map:map}); //Return back to the original position + //If you block your main code when is_moving(character), you can buy potions this way and return back without a hassle + }); +} + +buy_potions();