Signup Now
Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Free User WindWaker's Avatar
    Join Date
    Nov 2014
    Posts
    29
    Reputation
    10
    Rep Power
    0

    Code to check for duplicate item

    Howdy!

    I'm currently using a nice Hive script with acid tasker which is working really well. Only problem is I can't afk it totally since every refill I get an extra war drum in my BP. And after a while they fill up the main BP and render it unusable since I have supplies in there.

    So my question is, how to write a piece of code to check for doublettes and to get rid of the double? Help much appriciated!

  2. #2
    Free User ozzix's Avatar
    Join Date
    Jan 2014
    Location
    Sweden
    Posts
    4,769
    Reputation
    151
    Rep Power
    31
    moved to lua requests

    Level Latest Scripts
    250+
    Oramond Sewers [MAGE |RP X1 | RP X2 |RP X3|EK X2 | EK X1]
    200+
    Banuta X2 [MAGE | RP]
    280+
    Roshamuul Mountain [RP]
    280+
    Ferumbras Lair [RP]
    250+
    Roshamuul North Silencers [RP]

  3. #3
    Free User WindWaker's Avatar
    Join Date
    Nov 2014
    Posts
    29
    Reputation
    10
    Rep Power
    0
    Quote Originally Posted by ozzix View Post
    moved to lua requests

    Ah, sorry and thanks!

  4. #4
    Wind Tester
    Join Date
    Dec 2013
    Location
    Warsaw, Poland
    Posts
    2,569
    Reputation
    149
    Rep Power
    27
    init start
    local name = "???????" -- item name
    init end

    auto(1000)
    if itemcount(name) > 1 then
    pausewalking(20000)
    moveitems(name, ground($posx, $posy, $posz), 'all', 1)
    pausewalking(0)
    end
    Last edited by Imba; 03-04-2015 at 01:23 PM.

  5. #5
    Free User Eldar's Avatar
    Join Date
    Dec 2013
    Posts
    2,385
    Reputation
    63
    Rep Power
    25
    local ITEM_NAME = "enter item name"

    auto(500)
    if itemcount(ITEM_NAME) > 1 then
    moveitems(ITEM_NAME, ground($posx, $posy, $posz), "all", itemcount(ITEM_NAME)-1)
    end


    EDIT: Damn @Imba was first xD

  6. #6
    Free User WindWaker's Avatar
    Join Date
    Nov 2014
    Posts
    29
    Reputation
    10
    Rep Power
    0
    Quote Originally Posted by Imba View Post
    init start
    local name = "???????" -- item name
    init end

    auto(1000)
    if itemcount(name) > 1 then
    print('sdas')
    pausewalking(20000)
    moveitems(name, ground($posx, $posy, $posz), 'all', 1)
    pausewalking(0)
    end
    Thanks!

    Pardon my noobiness, but should I put this as a persistent script or as a cavebot action?

  7. #7
    Banned
    Join Date
    May 2014
    Location
    Somewhere in the world.
    Posts
    361
    Reputation
    71
    Rep Power
    0
    Quote Originally Posted by WindWaker View Post
    Thanks!

    Pardon my noobiness, but should I put this as a persistent script or as a cavebot action?
    For this concretely I would add it as cavebot.
    Think it this way:
    -As a persistent, it will work all the time.
    -As a cavebot action it will work ONLY when cavebot is working.

    Hope this helps you.
    Cheers,
    Dekk.

  8. #8
    Wind Tester
    Join Date
    Dec 2013
    Location
    Warsaw, Poland
    Posts
    2,569
    Reputation
    149
    Rep Power
    27
    @WindWaker i would also put it as Cavebot>Scripter
    btw copy my code again, i left some test line inside by mistake.

  9. #9
    Free User WindWaker's Avatar
    Join Date
    Nov 2014
    Posts
    29
    Reputation
    10
    Rep Power
    0
    @Imba @Dekk

    Thank you guys, works awesome! Starting to understand the basics of how the code works aswell, cheers!

  10. #10
    Free User WindWaker's Avatar
    Join Date
    Nov 2014
    Posts
    29
    Reputation
    10
    Rep Power
    0
    @Dekk @Imba

    Hey again guys. I tried this right now and when it comes to the action it just gives me an error that it cannot find an item named "swarmer drum". I've tried countless of options but to no avail. What it is supposed to say there?

 

 

Posting Permissions

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