diff --git a/runner_functions.js b/runner_functions.js index 6b71773..4132aea 100644 --- a/runner_functions.js +++ b/runner_functions.js @@ -16,6 +16,31 @@ function shift(num,name) // shifts an item, likely a booster, in the num-th inve parent.shift(num,name); } +function can_use(name) // work in progress, can be used to check cooldowns of class skills [02/02/17] +{ + return parent.can_use(name); +} + +function use(name,target) // a multi-purpose use function, works for skills too +{ + if(isNaN(name)) // if name is not an integer, use the skill + { + if(!target) target=get_target(); + parent.use_skill(name,target); + } + else + { + // for example, if there is a potion at the first inventory slot, use(0) would use it + equip(name); + } +} + +function use_skill(name,target) +{ + if(!target) target=get_target(); + parent.use_skill(name,target); +} + function item_properties(item) // example: item_properties(character.items[0]) { if(!item || !item.name) return {}; @@ -148,11 +173,6 @@ function equip(num) parent.socket.emit("equip",{num:num}); } -function use(num) // for example, if there is a potion at the first inventory slot, use(0) would use it -{ - equip(num); -} - function trade(num,trade_slot,price) // where trade_slot is 1 to 16 - example, trade(0,4,1000) puts the first item in inventory to the 4th trade slot for 1000 gold [27/10/16] { parent.trade("trade"+trade_slot,num,price); @@ -249,11 +269,11 @@ function use_hp_or_mp() if(safeties && mssince(last_potion)<600) return; var used=false; if(new Date()