Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: wgrzelak library

  1. #1
    Normal User
    Join Date
    May 2012
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    11
    Rep Power
    5

    wgrzelak library

    Code:
    --[[
                                             ___             __         
                                            /\_ \           /\ \        
     __  __  __     __   _ __   ____      __\//\ \      __  \ \ \/'\    
    /\ \/\ \/\ \  /'_ `\/\`'__\/\_ ,`\  /'__`\\ \ \   /'__`\ \ \ , <    
    \ \ \_/ \_/ \/\ \L\ \ \ \/ \/_/  /_/\  __/ \_\ \_/\ \L\.\_\ \ \\`\  
     \ \___x___/'\ \____ \ \_\   /\____\ \____\/\____\ \__/.\_\\ \_\ \_\
      \/__//__/   \/___L\ \/_/   \/____/\/____/\/____/\/__/\/_/ \/_/\/_/
                   /\____/                                             
                    \_/__/                
    -- wgrzelak.lua
    -- version 1.0.4
    -- last update 03/07/2012  
    ]]
    
    
    function setalarm(alarmtype, playsound, pausebot, disconnect)
    	local alarmtypes = {'onscreen', 'attacking', 'privatemessage', 'advanced', 'raid', 'capacity', 'standtime', 'disconnect'}
    	local pos = table.find(alarmtypes,alarmtype)
    	if not pos then
    		return false
    	end
    	local alarm = alarmtypes[pos]
    	if not playsound or playsound == 'off' or playsound == 'no' or playsound == 0 then
    		playsound = 'no'
    	elseif playsound == 'on' or playsound == 'yes' or playsound == 1 then
    		playsound = 'yes'
    	end	
    	if not pausebot or pausebot == 'off' or pausebot == 'no' or pausebot == 0 then
    		pausebot = 'no'
    	elseif pausebot == 'on' or pausebot == 'yes' or pausebot == 1 then
    		pausebot = 'yes'
    	end
    	if not disconnect or disconnect == 'off' or disconnect == 'no' or disconnect == 0 then
    		disconnect = 'no'
    	elseif disconnect == 'on' or disconnect == 'yes' or disconnect == 1 then
    		disconnect = 'yes'
    	end	
    	if alarm == 'onscreen' or alarm == 'attacking' then
    		types = '\\Player'	
    	elseif alarm == 'privatemessage' or alarm == 'advanced' or alarm == 'raid' then
    		types = '\\Message'
    	else types = ''
    	end
    	setsettings('Settings\\Alerts'..types..'\\'..alarm..'\\PlaySound', playsound)
    	setsettings('Settings\\Alerts'..types..'\\'..alarm..'\\FlashClient', playsound)
    	setsettings('Settings\\Alerts'..types..'\\'..alarm..'\\PauseBot', pausebot)
    	setsettings('Settings\\Alerts'..types..'\\'..alarm..'\\Disconnect', disconnect)
    	return true
    end
    
    function setpathfinding(areaname, set)
    	local types = {'None', 'Cavebot', 'Target', 'All'}
    	local check = table.find(types,set)
    	if not check then
    		return false
    	end
    	local t = types[check]
    	local path = 'Settings\\CaveBot\\Pathfinding\\SpecialAreas\\'..areaname..'\\ConsideredBy'
    	if getsettings(path) ~= '' and getsettings(path) ~= t then
    		setsettings(path, t)
    		wait(200,300)
    	end
    	return true
    end
    
    function sethotkey(namehotkey, set)
    	local typ = getsettings('Settings\\Actions\\List\\'..namehotkey..'\\Enabled')
    	if typ == set or set == nil or typ == nil then
    		return false
    	end
    	if set == 'yes' or set == 'on' or set == 1 then
    		set = 'yes'
    	elseif set == 'no' or set == 'off' or set == 0 then
    		set = 'no'
    	else 
    		set = 'no'
    	end
    	setsettings('Settings\\Actions\\List\\'..namehotkey..'\\Enabled', set)
    	wait(200,300)
    	return true
    end
    
    function setmount(set)
    	local typ = getsettings('Settings\\CaveBot\\Settings\\AutoMount')
    	if typ == set or set == nil or typ == nil then
    		return false
    	end
    	if set == 'yes' or set == 'on' or set == 1 then
    		set = 'yes'
    	elseif set == 'no' or set == 'off' or set == 0 then
    		set = 'no'
    	else 
    		set = 'no'
    	end
    	setsettings('Settings\\CaveBot\\Settings\\AutoMount', set)
    	wait(200,300)
    	return true
    end
    
    function mount(set)
    	return setmount(set)
    end
    
    function waitandlogout()
    	while connected do
    		while battlesigned do
    			pausewalking(300)
    			wait(100)
    		end
    		logout()
    		wait(200,300)
    	end
    end
    
    function cantalknpc(npc) --return true if can talk with npc
    	reachcreature(npc)
    	wait(300,400)
    	if findcreature(npc) <= 3 and findcreature(npc) ~= -1 then
    		return true
    	else
    		return false
    	end
    end
    
    function isshootablenpc(npc)
    	return cantalknpc(npc)
    end
    
    function refillsofts() --not working
    	local msgs = getmessages('NPCs')
    	local qtd = msgs.count-1
    	reachcreature('Aldo')
    	npctalk('hi')
    	wait(2000,3000)	
    	while itemcount(6530) > 0 and cantalknpc('Aldo') do
    	    npctalk('soft boots', 'yes') 
    		wat(300,600) 
    		for i=0,qtd do
    			if msgs[qtd].sender == 'Aldo' and msgs[qtd].text:find('At last, someone poorer than me.') then
    			return false
    			end
    		end
    		return true
    	end
    	return false
    end
    
    function breakdworcwall(x,y,z, walls, weapons)
    	x,y,z = x or wptx, y or wpty, z or wptz
    	walls = walls or {{2295, 3146}, {2296, 3145}}
    	local weaponid = weapons or machete
    	if weaponid == 0 then
    		return false
    	end
    	reachlocation(x,y,z)
    	if x and y and z and math.abs(posx-x) <= 7 and math.abs(posy-y) <= 5 and posz == z then
    		local v = 1
    		while v <= #walls and not isitemontile(walls[v][1],x,y,z) do
    			v = v+1
    		end
    		if v <= #walls then
    			local id = toptileitem(x,y,z)
    			while id ~= walls[v][2] do
    				if id == walls[v][1] then
    					if iscreatureontile(x,y,z) then
    						local dir = wheretomove(x,y,z)
    						moveitems(99,ground(x,y,z),ground(dir.x,dir.y,z),100) wait(1400,1600)
    					elseif itemcount(weaponid) == 0 then
    						return false
    					end
    					useitemon(weaponid,x,y,z) wait(900,1100)
    				else
    					local dir = wheretomove(x,y,z)
    					moveitems(id,ground(x,y,z),ground(dir.x,dir.y,z),100) wait(1400,1600)
    				end
    				id = toptileitem(x,y,z)
    			end
    			return true
    		end
    	end
    	return false
    end
    
    function withdraw(amount, npc, sayhi) --not tested
    	local data = {'Finarfin', 'Tesha', 'Eva', 'Muzir', 'Ebenizer', 'Murim', 'Lokur', 'Jefrey', 'Raffael', 'Ferks', 'Paulie', 'Jessica', 'Naji', 'Rokyn', 'Znozel', 'Eighty'}
        local check = table.find(data,npc)
    	local n = data[check]
    	if not amount or amount == 0 or n ~= npc or not cantalknpc(n) then
            return false
        end
    	reachcreature(n)
    	if sayhi == true then
    		npctalk('hi', 'withdraw ' .. amount, 'yes')
    		wat(300,600) 
        else
    		wait(100)
            npcsay('withdraw ' .. amount) 
    		wait(1000,2000)
    		npcsay('yes') 
    		wat(300,600) 
        end
        wait(300,400)	
    	local npcname = n
    	local msgs = getmessages('NPCs')
    	local qtd = msgs.count-1
    	for i=0,qtd do
    		if msgs[qtd].sender == npcname and msgs[qtd].text:find('There is not enough gold on your account.') then
    			return false
    		end
    	end
        return true
    end
    
    function npctalk(...)
    	local arg = {...}
    	for i,j in ipairs(arg) do
          if not ischannel('NPCs') then
    		say(j)
    		wait(2000,3000)
    	  else
    		npcsay(j)
    		wait(500,1000)
    	  end
       end
    end
    
    function moveitemonground(x,y,z,a,b,c)
    	moveitems(toptileitem(x,y,z),ground(a,b,c),ground(x,y,z),100)
    	wait(1400,1600)
    end
    
    function playsoundflash(alert)
    	alert = alert or "alert.wav"
    	playsound(alert)
    	flashclient()
    	wait(2000)
    end
    • setalarm(string alarmtype, string value, string value, string value)
      Set Alarm 'yes', 'on', '1' or 'no', 'off', '0'.

    • setpathfinding(string areaname, string value)

    • sethotkey(string namehotkey, string value)

    • setmount(string value)
      Set AutoMount 'yes', 'on', '1' or 'no', 'off', '0'.

    • waitandlogout()

    • cantalknpc()
      Return true if can talk with npc.

    • refillsofts()
      Refill soft boots, return false if not find npc on screen, if you have no money or 'soft boots > 0'.

    • breakdworcwall(int x, int y, int z, optional walls, optional weapons)
      Break dworc wall of at given coordinates.

    • withdraw(int amount, string npc, optional sayhi)

    • ischannel(string channel)
      Return true if channel is open.

    • npctalk(string text)
      Say first parameter in default channel if NPC's closed or NPCs if open, example 'hi', 'deposit all', 'yes'.

    • moveitemonground(x,y,z,a,b,c)

    • playsoundflash(string alert)
      Default alert "alert.wav".
    Last edited by wgrzelak; 07-03-2012 at 08:50 AM.

  2. #2
    Banned
    Join Date
    Feb 2012
    Location
    www.dvscripts.com
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    0
    Good job

  3. #3
    Normal User
    Join Date
    May 2012
    Posts
    78
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    11
    Rep Power
    5
    Good Job! +1

  4. #4
    Banned
    Join Date
    Mar 2012
    Location
    Poland !
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    2
    Rep Power
    0
    Wow nice job man

  5. #5
    Normal User
    Join Date
    Mar 2012
    Location
    www.lucksstore.com
    Posts
    966
    Mentioned
    17 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    24 Post(s)
    Reputation
    59
    Rep Power
    6
    setpathfinding(string areaname, string value)

    good..


    Vendo Tibia coin a 34,00 reais cada 250
    Entre em contato via facebook Link na foto acima

  6. #6
    Normal User
    Join Date
    May 2012
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    11
    Rep Power
    5
    Quote Originally Posted by Ropiderz View Post
    Really good job, but why you don't post in scripts section with your "Name's Library" and continue doing the nice work?

    mistake, someone can move topic?

    add:
    sethotkey()
    moveitemonground()
    Last edited by wgrzelak; 06-11-2012 at 12:54 PM.

  7. #7
    Normal User Nasionka's Avatar
    Join Date
    May 2012
    Location
    Uk
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    13
    Rep Power
    5
    Good job! Keep going!

  8. #8
    Normal User
    Join Date
    Mar 2012
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    5
    Good job!

  9. #9
    Normal User
    Join Date
    Mar 2012
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    19
    Rep Power
    5
    pra que serve isso?

  10. #10
    Normal User LeilarScripts's Avatar
    Join Date
    May 2012
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    11
    Rep Power
    5
    Quote Originally Posted by wgrzelak View Post
    mistake, someone can move topic?

    add:
    sethotkey()
    moveitemonground()
    Done. If you want me to change the name also, leave me a comment with the new thread name in quotes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •