Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Griloh's library
03-02-2018, 04:22 PM, (This post was last modified: 04-07-2018, 04:23 PM by raphlmiranda. Edit Reason: Added bugMap function )
#1
Griloh's library
Hello mates, i've used alot of time magebot scripts and i want share with you, this some functions from my library.

Quote:top=69
topleft=985

-- INFO FUNCTION -- 

-- targetInfo('direction') [will return direction your target is turned (north, east, west, south)]
function targetInfo(arg) -- return infos about target

local infoPlayer = GetTarget()
local target = GetCreatureData(infoPlayer.id)
local config = {
['x'] = target.x,
['y'] = target.y,
['z'] = target.z,
['hp'] = target.hp,
['movespeed'] = target.movespeed,
['name'] = target.name,
['atk'] = target.atk,
['iswalking'] = target.iswalking,
['direction'] = target.direction,
['outfit'] = target.outfit,
['outfithead'] = target.outfithead,
['light'] = target.light,
['isvisible'] = target.isvisible,
['skull'] = target.skull,
['walkingx'] = target.walkingx,
['walkingy'] = target.walkingy
}

for k, v in pairs(config) do
if k == arg then
return v
end
end

end

-- ATTACK FUNCTION --

--moveTargetPlayer(1, 1)
function moveTargetPlayer(sx, sy) -- Move player if you're attacking (return void)

local target = GetTarget()
ThrowItemGtoG(target.x,target.y, target.x+sx, target.y+sy, target.id, 1)
end

-- FOLLOW FUNCTION --

--moveFollowPlayer(1, 1)
function moveFollowPlayer(sx, sy) -- Move player if you're following (return void)

local target = GetFollow()
ThrowItemGtoG(target.x,target.y, target.x+sx, target.y+sy, target.id, 1)
end

-- AMULET FUNCTION -- 

--autoAmulet(80, 'stone skin amulet', 'F9')
function autoAmulet(percent, amulet, htk) -- Equip amulet based on your life percent (use hotkey)

local nameAmulet = {
['stone skin amulet'] = 3081,
['garlic necklace'] = 3083,
['amulet of loss'] = 3057
}

local hpPercent = (percent*self.hpmax)/100
--local amulet = FindItem(ssaID)

for k, v in pairs(nameAmulet) do
if k == amulet then
if self.ammy ~= v or self.hp < hpPercent then
CastHotkey(htk)
                                --KeyDown(htk)
end
end
end

end

-- RING FUNCTION --

--autoRing(90, 'energy ring', 'F3', 'F10')
function autoRing(percent, ring, htk, htkt) -- Equip ring based on your life percent (use hotkey)

local nameRing = {
['energy ring'] = {equiped = 3088, uequiped = 3051},
['time ring'] = {equiped = 3053, uequiped = 3053},
['might ring'] = {equiped = 3048, uequiped = 3048}
}

local hpPercent = (percent*self.hpmax)/100
--local ring = FindItem(ringID)

for k, v in pairs(nameRing) do
if k == ring then
if self.ring ~= v.uequiped or self.hp < hpPercent then
CastHotkey(htk)
DrawText("On ",topleft+70, top, 0xFF32CD32)
elseif (self.ring == v.equiped and self.hp > hpPercent) or (self.ring == v.equiped and self.mp < 500) then
CastHotkey(htkt)
DrawText("Off ",topleft+70, top, 0xFF0000FF)
end
end
end

end

function bugMap(param)

if param == 'north' then
local x, y = self.x, self.y-3
local ground = GetGround(x, y)
if ground ~= nil then
UseGroundItem(x, y, ground[1])
end
elseif param == 'east' then
local x, y = self.x+3, self.y
local ground = GetGround(x, y)
if ground ~= nil then
UseGroundItem(x,y,ground[1])
end
elseif param == 'west' then
local x, y = self.x-3, self.y
local ground = GetGround(x, y)
if ground ~= nil then
UseGroundItem(x,y,ground[1])
end
elseif param == 'south' then
local x, y = self.x, self.y+3
local ground = GetGround(x, y)
if ground ~= nil then
UseGroundItem(x,y,ground[1])
end
end

end
Reply
04-05-2018, 03:38 AM, (This post was last modified: 04-05-2018, 03:39 AM by Nexu.)
#2
RE: Griloh's library
Unfortunately It doesn't work in magebot version 10a , would you mind explaining how do you run any of those functions ? Ive tried creating lua file and running in script it wont work ! It wont even highlight like 100gp to platinum script.
Reply
04-05-2018, 11:33 AM, (This post was last modified: 04-05-2018, 03:26 PM by Nexu.)
#3
RE: Griloh's library
[Image: error.png]@raphlmiranda Could reupload code Pasting it here Wklej.org

using Function "Lua"

So it Looks like this ?  http://wklej.org/id/3400799/

Your script wont work and cant execute them properly due it not being in Lua format  Sad
Reply
04-07-2018, 04:20 PM,
#4
RE: Griloh's library
Hello friend, this is a library you need save this file in your magebot directory like "library.lua", and call this file in other .lua.

Quote:require('library')
if isKeyDown(97) then -- 97 {Numpad key 1}
moveTargetPlayer(1, 1)
end

SetTimerCallback("yourlua")

Understand ? If need some more help pm me here and i'll help you in your questions
Reply
04-24-2018, 06:22 PM,
#5
RE: Griloh's library
Still doesnt work Sad
Reply
04-24-2018, 06:25 PM,
#6
RE: Griloh's library
Ive created Library and Push files

In Library file its whole your library in Push file its
require('library')
if isKeyDown(97) then -- 97 {Numpad key 1}
moveTargetPlayer(1, 1)
end

SetTimerCallback("yourlua")


Still wont work Idk how to enable this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)