Signup Now
Results 1 to 7 of 7
  1. #1
    Free User
    Join Date
    Jan 2014
    Posts
    15
    Reputation
    10
    Rep Power
    0

    Royal Spear from depot - action

    Hi, i'm new in scripting and i need action to get royals from depot, how to do it?
    Nextly what action to open door?

  2. #2
    Free User Donatello's Avatar
    Join Date
    Dec 2013
    Location
    Tuscany, Italy
    Posts
    398
    Reputation
    51
    Rep Power
    22
    First request:
    Depends on how you'll setup it, On this case you'll have one backpack inside your depot chest with a lot of spears.
    init start
    local bpDepotAmmo = "green backpack"
    local ammoName = "royal spear"
    local ammoToMove = 40
    local whereToMove = "backpack of holding" -- you can set your rhand, if you want.
    init end

    opendepot() wait(1500, 2500)
    openitem(bpDepotAmmo ) waitcontainer(bpDepotAmmo)
    moveitemsupto(ammoName, ammoToMove, whereToMove, bpDepotAmmo)
    if itemcount(bpDepotAmmo, bpDepotAmmo) > 0 and itemcount(ammoName, bpDepotAmmo) == 0 then
    openitem(bpDepotAmmo, bpDepotAmmo) waitping()
    end


    Second request:
    init start
    local DoorID = 8120 -- Closed door ID.
    local pos = {$wptx, $wpty, $wptz} -- Coordinates from door, you can just create an action on sqm on door and it'll be fine.
    init end

    if topitem(unpack(pos)).id == DoorID then
    useitem(DoorID, ground(unpack(pos))) waitping()
    end


    These are just simple examples, they'll work but keep in mind that it's a simple code.
    Last edited by Donatello; 01-22-2014 at 08:03 PM.

  3. #3
    Free User
    Join Date
    Jan 2014
    Posts
    15
    Reputation
    10
    Rep Power
    0
    both don't working for me, but thanks

    Spear:
    error in Action script TakeSpears:
    ["while itemcount(itemname, to) < amou..."]:LucasTerra.lua:1795 attempt to compare number with nil
    stack traceback:
    [" moveitemsupto(ammoName, ammoTomove, whereToMove, bpDepot..."]:id:7:10 in user script


    Door Opener do nothing, no console error etc


    E: Door opener problem solved, usegrounditem(id_door)
    Still need working script for royal spears from dp
    Last edited by kolouiy; 01-22-2014 at 05:50 PM.

  4. #4
    Free User Donatello's Avatar
    Join Date
    Dec 2013
    Location
    Tuscany, Italy
    Posts
    398
    Reputation
    51
    Rep Power
    22
    Fixed, you just need to change ammoTomove for ammoToMove

  5. #5
    Banned
    Join Date
    Aug 2014
    Posts
    170
    Reputation
    14
    Rep Power
    0
    Quote Originally Posted by Donatello View Post
    First request:
    Depends on how you'll setup it, On this case you'll have one backpack inside your depot chest with a lot of spears.
    init start
    local bpDepotAmmo = "green backpack"
    local ammoName = "royal spear"
    local ammoToMove = 40
    local whereToMove = "backpack of holding" -- you can set your rhand, if you want.
    init end

    opendepot() wait(1500, 2500)
    openitem(bpDepotAmmo ) waitcontainer(bpDepotAmmo)
    moveitemsupto(ammoName, ammoToMove, whereToMove, bpDepotAmmo)
    if itemcount(bpDepotAmmo, bpDepotAmmo) > 0 and itemcount(ammoName, bpDepotAmmo) == 0 then
    openitem(bpDepotAmmo, bpDepotAmmo) waitping()
    end


    Second request:
    init start
    local DoorID = 8120 -- Closed door ID.
    local pos = {$wptx, $wpty, $wptz} -- Coordinates from door, you can just create an action on sqm on door and it'll be fine.
    init end

    if topitem(unpack(pos)).id == DoorID then
    useitem(DoorID, ground(unpack(pos))) waitping()
    end


    These are just simple examples, they'll work but keep in mind that it's a simple code.
    but i need something to check how much he had in hand. because i have to withdraw 20, but character have like 10 so bot withdraw 20 so together is 30, i want just 20 :P how make it item count?

  6. #6
    Free User
    Join Date
    Feb 2014
    Posts
    3
    Reputation
    10
    Rep Power
    0
    Quote Originally Posted by trololo View Post
    but i need something to check how much he had in hand. Because i have to withdraw 20, but character have like 10 so bot withdraw 20 so together is 30, i want just 20 how make it item count?
    i need one action to do it too =\\\\

  7. #7
    Helper StaR's Avatar
    Join Date
    Dec 2013
    Location
    Manchester
    Posts
    712
    Reputation
    50
    Rep Power
    23
    This checks how many you have in your hand.
    itemcount('spear', 'rhand')



 

 

Posting Permissions

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