Author Topic: noob question about items spawning inside of chests  (Read 4878 times)

0 Members and 1 Guest are viewing this topic.

Offline satoreyTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Activity:
    0%
  • Reputation Power: 1
  • satorey has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
noob question about items spawning inside of chests
« on: March 04, 2012, 06:11:09 AM »
0
I apologize in advance if this is a super noobish question, i have tried looking for ways to do this myself and have just failed. What i want to basically accomplish is a script that will watch a certain chest/container and when items spawn inside of that container it will alert me.Ive been doing alot of reading trying to figure out how to get the script to do this and i tried to have the script click on the chest and then read the journal but that info doesnt seem to get picked up in scanjournal. Im sure there is a 1000 times better way to achieve this i was just hoping someone could push me in the right direction. Thanks in advance.

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +861
  • Referrals: 11
    • View Profile
Re: noob question about items spawning inside of chests
« Reply #1 on: March 04, 2012, 08:06:59 AM »
0
Use event property perhaps?
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline camotbik

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +90
  • Referrals: 0
    • View Profile
Re: noob question about items spawning inside of chests
« Reply #2 on: March 04, 2012, 09:17:21 AM »
0
well, you could just check for the items you desire, for example gold, as it will respawn each time, so some thing like this?
Code: [Select]
set %chesttype AAA
set %itemtype BBB_CCC_DDD

repeat
  gosub Check_chest
  wait 50
until #charghost = yes
stop

Sub Check_chest
  finditem %chesttype G_2
  if #findcnt > 0
  {
    set %current_chest #findid
    set #lobjectid %current_chest
    while #contid <> %current_chest
    {
      event macro 17
      wait 20
    }
    finditem %itemtype C_ , %current_chest
    if #findcnt > 0
    {
      display the stuff is found
      pause
      ; You could add looting(check exevent drag, exevent drop on wiki) or whatever here.
    }
  }
return
« Last Edit: March 04, 2012, 09:19:24 AM by camotbik »
What you witness -- is whatver..
uogamers hybrid.

Offline satoreyTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Activity:
    0%
  • Reputation Power: 1
  • satorey has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: noob question about items spawning inside of chests
« Reply #3 on: March 04, 2012, 11:35:27 AM »
0
thanks for the help so far. the problems im having with that macro is that the chest im watching in an armoire. so it shows when you open and close it and it only gives you a backpack gump when you open it not when you close it. that is why i was leaning towards using a click/check journal approach which i did end up figuring out. my next problem is im trying to steal the item when it spawns, and i get it to the point where i try and use event macro 22 last target it doesnt target the item and then it doesnt let me use skills after that to saying im busy. here is my junk code for that section, pretty sure im doing alot wrong lol.
Code: [Select]
sub steal
    set #lobjectid JAACOMD ;id of container spawn is in
    event macro 17
    wait 20
    finditem EGG C_JAACOMD ; item ids c_spawning container id
    if #findkind -1
        { event macro 17
          finditem EGG C_JAACOMD  ; item ids c_spawning container id
        }
    set #ltargetid #findid
    event macro 13 33
    target
    event macro 22 0
    wait 10
    set #ltargetid MEFQYMD ;recall rune set here
    event macro 15 31
    target
    event macro 22 0
    wait 10
    event macro 4 4 BANK
    finditem EGG C_KNFHLMD ;item ids c_backpackid
    gosub moveitem #findid KNFHLMD EPIPUMD ; call sub (itemid) (fromcontainredID) (tocontainerID)
    halt
    return

Post Merge: March 04, 2012, 05:19:29 PM
problem solved thanks for your help
« Last Edit: March 04, 2012, 05:19:29 PM by satorey »

Offline Cstalker

  • Google Slut
  • ScriptUO Beta Tester
  • ***
  • *
  • Posts: 179
  • Activity:
    0%
  • Reputation Power: 0
  • Cstalker has no influence.
  • Gender: Male
  • Respect: +23
  • Referrals: 0
    • View Profile
Re: noob question about items spawning inside of chests
« Reply #4 on: March 04, 2012, 10:36:33 PM »
0
thanks for the help so far. the problems im having with that macro is that the chest im watching in an armoire. so it shows when you open and close it and it only gives you a backpack gump when you open it not when you close it. that is why i was leaning towards using a click/check journal approach which i did end up figuring out. my next problem is im trying to steal the item when it spawns, and i get it to the point where i try and use event macro 22 last target it doesnt target the item and then it doesnt let me use skills after that to saying im busy. here is my junk code for that section, pretty sure im doing alot wrong lol.
Code: [Select]
sub steal
    set #lobjectid JAACOMD ;id of container spawn is in
    event macro 17
    wait 20
    finditem EGG C_JAACOMD ; item ids c_spawning container id
    if #findkind -1
        { event macro 17
          finditem EGG C_JAACOMD  ; item ids c_spawning container id
        }
    set #ltargetid #findid
    event macro 13 33
    target
    event macro 22 0
    wait 10
    set #ltargetid MEFQYMD ;recall rune set here
    event macro 15 31
    target
    event macro 22 0
    wait 10
    event macro 4 4 BANK
    finditem EGG C_KNFHLMD ;item ids c_backpackid
    gosub moveitem #findid KNFHLMD EPIPUMD ; call sub (itemid) (fromcontainredID) (tocontainerID)
    halt
    return

Post Merge: March 04, 2012, 05:19:29 PM
problem solved thanks for your help

first off your finditem is wrong.

Code: [Select]
     finditem EGG C_JAACOMD ; item ids c_spawning container id
    if #findkind -1
       

should be
Code: [Select]
finditem EGG C_ , JAACOMD ; item ids c_spawning container id
        if #findkind -1
        }

Try this, it should work assumeing you have the proper ids for everything
Code: [Select]
sub steal
    set #lobjectid JAACOMD ;id of container spawn is in
    event macro 17
    wait 20
    finditem EGG C_ , JAACOMD ; item ids c_spawning container id
    wait 2  ; a small delay to ensure the finditem reads
    if #findcnt > 1 ; i always use findcnt over findkind, i find it more stable
        {
             set %stolen_item #findid  ; set your stolen item id here so it can be used later to unload
             set #ltargetid %stolen_item
             set #ltargetkind #findkind
             event macro 13 33
             target
             event macro 22 0
             wait 10
        ; recall to bank
             set #ltargetid MEFQYMD ;recall rune set here
             event macro 15 31
             target 2s ; wait for lag, adjsut as needed
             event macro 22 0
             wait 10
        ; open bank
             event macro 4 4 BANK
        ; drag stolen item to storage bag in bank
             finditem %stolen_item C_ , #backpackid ;item ids c_backpackid
             wait 2
             gosub moveitem %stolen_item #findstack EPIPUMD ;  call sub (itemid) (fromcontainredID) (tocontainerID)
             halt
        }
return

; %1 = itemid to drag
; %2 = the amount to move
; %3= where to move it to
sub moveitem
    exevent drag %1 %2
    wait 5
    exevent dropc %3
    wait 5
return

Offline satoreyTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Activity:
    0%
  • Reputation Power: 1
  • satorey has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: noob question about items spawning inside of chests
« Reply #5 on: March 07, 2012, 04:38:05 AM »
0
yah thats way better then mine lol. thanks so much for the help.

Offline Cstalker

  • Google Slut
  • ScriptUO Beta Tester
  • ***
  • *
  • Posts: 179
  • Activity:
    0%
  • Reputation Power: 0
  • Cstalker has no influence.
  • Gender: Male
  • Respect: +23
  • Referrals: 0
    • View Profile
Re: noob question about items spawning inside of chests
« Reply #6 on: March 07, 2012, 05:23:56 AM »
0
so it worked? I have been out of the scripting for a few years so i am a little rusty. But questions like this help get the old gears turning again.

Tags: