Signup Now
Results 1 to 3 of 3

Thread: Banker category

  1. #1
    Free User Akiller's Avatar
    Join Date
    Aug 2015
    Posts
    240
    Reputation
    33
    Rep Power
    18

    Banker category


    as function say:
    supplycategory = all categories 'prf'
    withdrawcash = true/false (default is set to false)
    logoutnocash = true/false (default is set to true)
    extragold = extra gps (default is set to 0)

    function bankdepositer(supplycategory, withdrawcash, logoutnocash, extragold)

    example facc:
    bankdepositer('prf', true)

    example pacc:
    bankdepositer('prf')


    function bankdepositer(supplycategory, withdrawcash, logoutnocash, extragold)
    local function findnamebanker()
    local banknpclst = {'Znozel', 'Wentworth', 'Virgil', 'Tesha', 'Suzy', 'Siestaar', 'Rokyn', 'Raffael',
    'Plunderpurse', 'Paulie', 'Naji', 'Muzir', 'Murim', 'Lokur', 'Kepar', 'Kaya', 'Jessica', 'Jefrey',
    'Gnomillion', 'Finarfin', 'Ferks', 'Eva', 'Eighty', 'Ebenizer'}
    foreach creature m 'ns' do
    if table.find(banknpclst, m.name) then
    return m.name
    end
    end
    return ''
    end
    if #supplycategory == 0 then printerror('provide categories') return false end
    withdrawcash = false or withdrawcash
    logoutnocash = true or logoutnocash
    extragold = 0 or extragold
    ::redo::
    local bankname = findnamebanker()
    if bankname == '' then
    printerror('unable to find banker npc close to you')
    return false
    else
    local cre = getcreature(bankname)
    if cre.dist > 3 then
    if cre.isreachable then
    reachlocation(cre.posx,cre.posy,cre.posz, math.random(1,3))
    else
    reachlocation(cre.posx,cre.posy,cre.posz, 3)
    end
    else
    if cre.dist > 3 then goto redo end
    if not ischannel('NPCs') then
    say('hi') wait(1000,1500)
    else
    npcsay('hi') wait(1000,1500)
    end
    npctalk('deposite all','yes','balance') wait(1000,1500)
    if cre.dist > 3 then goto redo end
    local towithdraw = moneytowithdraw(supplycategory) + extragold
    if towithdraw == 0 then
    return true
    end
    if cre.dist > 3 or not waitmessage('', 'Your account balance is %d+', 2000, true, MSG_NPC) then goto redo end
    if $balance >= towithdraw then
    if withdrawcash then
    if cre.dist <= 3 then
    npctalk('withdraw '..towithdraw, 'yes') wait(1000,1500)
    if logoutnocash and $lastnpcmsg.content == 'You don\'t have enough money.' then
    printerror('you don\'t have enought money in bank for journey')
    logout()
    setcavebot('off')
    return false
    end
    if not waitmessage(bankname, 'Here you are, '..towithdraw..' gold. Please let me know if there is something else I can do for you.', 2000, false, MSG_NPC) then goto redo else return true end
    end
    end
    return true
    end
    end
    return false
    end
    end
    Last edited by Akiller; 07-06-2016 at 10:57 AM.

  2. #2

  3. #3
    Free User Akiller's Avatar
    Join Date
    Aug 2015
    Posts
    240
    Reputation
    33
    Rep Power
    18
    @Cisco
    thanks

 

 

Posting Permissions

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