Author Topic: Find Bag , C_ -> Return Result  (Read 4290 times)

0 Members and 1 Guest are viewing this topic.

Offline GuadahTopic starter

  • Full Member
  • ***
  • Posts: 119
  • Activity:
    0%
  • Reputation Power: 3
  • Guadah has no influence.
  • Gender: Male
  • Who farted?!
  • Respect: +29
  • Referrals: 3
    • View Profile
    • L%N Website
Find Bag , C_ -> Return Result
« on: September 13, 2011, 04:56:19 AM »
0
So I have a script that saves the id's of bags selected and opens them upon start up, so you don't have to select the bags each time you start to run the script.  However, if you are not near the bag, it errors...  So I'm trying to figure out a way to write

find %resource_bag C_
if %resource_bag (not found)
 gosub set_resource_bag

My problem is I'm not sure what to code for the (not found) part.  Suggestions?

(I'm going to blame this on lack of sleep...)

Offline camotbik

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Re: Find Bag , C_ -> Return Result
« Reply #1 on: September 13, 2011, 05:10:19 AM »
0
you mean something like this? Or did I get you wrong?
Code: [Select]
finditem %resource_bag C_
if #findcnt = 0
{
  set #lobjectid %secure
  while #contid <> %secure
  {
    event macro 17
    wait 10
  }
  finditem %bag C_ , %secure
  if #findcnt > 0
    set %resource_bag #findid
  else
  {
    display no bags found
    stop
  }
}
What you witness -- is whatver..
uogamers hybrid.

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: Find Bag , C_ -> Return Result
« Reply #2 on: September 13, 2011, 06:11:16 AM »
0
you mean something like this? Or did I get you wrong?
Code: [Select]
finditem %resource_bag C_
if #findcnt = 0
{
  set #lobjectid %secure
  while #contid <> %secure
  {
    event macro 17
    wait 10
  }
  finditem %bag C_ , %secure
  if #findcnt > 0
    set %resource_bag #findid
  else
  {
    display no bags found
    stop
  }
}

where u got %Secure?

Code: [Select]
Finditem %Ressourcebag C
if #findkind <> -1
{
set %Yourbag #findid
return #true
}
Else
{
display yesno No Bag Found, want to target manualy?
if #dispres = yes
{
set #targcurs 1
while #targcurs=1
{
wait 1
}
set %Yourbag #ltargetID
return #true
}
else
{
return #false
}
}
Maybe something liemk this?

Offline camotbik

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Re: Find Bag , C_ -> Return Result
« Reply #3 on: September 13, 2011, 06:42:09 AM »
0
well if no %resource_bag found, he takes it from secure.. Well it was just a thought.
What you witness -- is whatver..
uogamers hybrid.

Offline GuadahTopic starter

  • Full Member
  • ***
  • Posts: 119
  • Activity:
    0%
  • Reputation Power: 3
  • Guadah has no influence.
  • Gender: Male
  • Who farted?!
  • Respect: +29
  • Referrals: 3
    • View Profile
    • L%N Website
Re: Find Bag , C_ -> Return Result
« Reply #4 on: September 13, 2011, 07:04:07 AM »
0
I scratched the entire idea.  It was overly complicated and not necessary afterall.  The main issue was if the Secure was not open, they could not open their resources bag... since I never call for them to target the 'secure' or 'bank'.  It was just an attempt at a safety measure, but I'm not going to release this script to the public.  It's just my version of a Slayer book maker.

Offline camotbik

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Re: Find Bag , C_ -> Return Result
« Reply #5 on: September 13, 2011, 07:13:28 AM »
0
put this before the code and you will be fine.
Code: [Select]
  set #lobjectid %secure
  while #contid <> %secure
  {
    event macro 17
    wait 10
  }
What you witness -- is whatver..
uogamers hybrid.

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: Find Bag , C_ -> Return Result
« Reply #6 on: September 13, 2011, 07:44:43 AM »
0
put this before the code and you will be fine.
Code: [Select]
  set #lobjectid %secure
  while #contid <> %secure
  {
    event macro 17
    wait 10
  }
Code: [Select]
  while #contid <> %secure
  {
  set #lobjectid %secure
    event macro 17
    wait 10
  }
Dunno i would do like this because if you overlay other targeting it could be complicated...

Offline GuadahTopic starter

  • Full Member
  • ***
  • Posts: 119
  • Activity:
    0%
  • Reputation Power: 3
  • Guadah has no influence.
  • Gender: Male
  • Who farted?!
  • Respect: +29
  • Referrals: 3
    • View Profile
    • L%N Website
Re: Find Bag , C_ -> Return Result
« Reply #7 on: September 13, 2011, 09:11:45 AM »
0
If I go the route for working this script out of the house, I'll re-write it in.  As it stands, it works at a bank.  Crafts a bag full of runebooks, checks them for Super-Slayers, bags them, Recalls to the Library... then won't open up the Gump from the NPC.  Then it'll recall back to the bank and repeat.

Everything except for the NPC works so far.  But I'll get it.

Code: [Select]
sub library
gosub TM_TravelFromRunebook RE 11 12 %runebookid
finditem %npc
set %lobjectid #findid
event macro 17 0
 wait 10
set %x #contposx + 40
set %y #contposy + 165
click %x %y ; Donate a Bag
set #ltargetid %dump_bag
while #targcurs <> 1
  event macro 22 0
 wait 10
set %x #contposx + 355
set %y #contposy + 340
click %x %y ; Donate ALL
 wait 10
gosub TM_TravelFromRunebook RE 4 5 %runebookid
gosub reopen_bags
return

Offline Neo

  • Prime Program
  • Elite
  • *
  • *
  • Posts: 821
  • Activity:
    0%
  • Reputation Power: 13
  • Neo barely matters.Neo barely matters.
  • Respect: +155
  • Referrals: 3
    • View Profile
Re: Find Bag , C_ -> Return Result
« Reply #8 on: September 13, 2011, 10:32:03 AM »
0
If I go the route for working this script out of the house, I'll re-write it in.  As it stands, it works at a bank.  Crafts a bag full of runebooks, checks them for Super-Slayers, bags them, Recalls to the Library... then won't open up the Gump from the NPC.  Then it'll recall back to the bank and repeat.

Everything except for the NPC works so far.  But I'll get it.

Code: [Select]
sub library
gosub TM_TravelFromRunebook RE 11 12 %runebookid
finditem %npc
set %lobjectid #findid
event macro 17 0
 wait 10
set %x #contposx + 40
set %y #contposy + 165
click %x %y ; Donate a Bag
set #ltargetid %dump_bag
while #targcurs <> 1
  event macro 22 0
 wait 10
set %x #contposx + 355
set %y #contposy + 340
click %x %y ; Donate ALL
 wait 10
gosub TM_TravelFromRunebook RE 4 5 %runebookid
gosub reopen_bags
return

line 4: set %lobjectid #findid
should be set #lobjectid #findid

I guess that should make it work heh
Never refuse an invitation.
Never resist the unfamiliar.
Never fail to be polite.
And never outstay your welcome.

Offline GuadahTopic starter

  • Full Member
  • ***
  • Posts: 119
  • Activity:
    0%
  • Reputation Power: 3
  • Guadah has no influence.
  • Gender: Male
  • Who farted?!
  • Respect: +29
  • Referrals: 3
    • View Profile
    • L%N Website
Re: Find Bag , C_ -> Return Result
« Reply #9 on: September 13, 2011, 10:55:15 AM »
0
haha, yeah that'll do it.  Making some modifications etc and then I'll get back to testing it out.  If I get it working smoothly I'll post it here if anybody wants it.

Offline GuadahTopic starter

  • Full Member
  • ***
  • Posts: 119
  • Activity:
    0%
  • Reputation Power: 3
  • Guadah has no influence.
  • Gender: Male
  • Who farted?!
  • Respect: +29
  • Referrals: 3
    • View Profile
    • L%N Website
Re: Find Bag , C_ -> Return Result
« Reply #10 on: September 13, 2011, 11:44:43 AM »
0
Just trying to work out how to read if the spellbook has 3 Mod Properties... then I'll post it.

Offline camotbik

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Re: Find Bag , C_ -> Return Result
« Reply #11 on: September 13, 2011, 12:11:26 PM »
0
Code: [Select]
set #lobjectid #findid
event macro 17 0
 wait 10
[code]
you may want to wait for the gump instead of just inserting a regular wait
[code]
set %gump_timer ( #sCnt + 5 )
while #gumpsize <> 23000_204499 || #sCnt < %gump_timer
wait
dont forget to change the gump size.[/code][/code]
What you witness -- is whatver..
uogamers hybrid.

Offline GuadahTopic starter

  • Full Member
  • ***
  • Posts: 119
  • Activity:
    0%
  • Reputation Power: 3
  • Guadah has no influence.
  • Gender: Male
  • Who farted?!
  • Respect: +29
  • Referrals: 3
    • View Profile
    • L%N Website
Re: Find Bag , C_ -> Return Result
« Reply #12 on: September 13, 2011, 12:17:45 PM »
0
I did.  Check out the script, give it a test run, let me know what you think.

http://www.scriptuo.com/index.php?topic=8503.msg73337#new

Tags: