Author Topic: Having problems using last target  (Read 4813 times)

0 Members and 1 Guest are viewing this topic.

Offline alaskanTopic starter

  • Jr. Member
  • **
  • Posts: 29
  • Activity:
    0%
  • Reputation Power: 1
  • alaskan has no influence.
  • Gender: Male
  • Respect: 0
  • Referrals: 0
    • View Profile
Having problems using last target
« on: May 04, 2014, 05:14:25 PM »
0
Hey guys trying to make a healing script for the free shard that I play on. I'm having issues using the last object that was selected by my target prompt. Please help  :)
Code: [Select]
;========Select Bag with bandis=========
display Choose your bag that contains bandages
if #dispres = ok
{
  repeat
    {
      set #targcurs 1
    }
  until #targcurs = 0
  set #ltargetid %container
  set #ltargetkind 1
  event macro 22 0
  finditem ZLF C_ , %container
  if #findcnt > 0
  {
    set #lobjectid #findid
    goto mainloop
  }
  else
    if #findcnt < 1
  {
    display Couldn't find any bandages
    halt
  }
}
« Last Edit: May 04, 2014, 05:38:10 PM by alaskan »
"You miss 100% of the shots you don't take" - Wayne Gretzky

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +556
  • Referrals: 0
    • View Profile
Re: Having problems using last target
« Reply #1 on: May 04, 2014, 05:27:22 PM »
0
Does your shard have
event macro 58  ---   Aids self.

I do believe your aids required to be in your main pack. That were I have my.

Offline alaskanTopic starter

  • Jr. Member
  • **
  • Posts: 29
  • Activity:
    0%
  • Reputation Power: 1
  • alaskan has no influence.
  • Gender: Male
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: Having problems using last target
« Reply #2 on: May 04, 2014, 05:32:33 PM »
0
I've tried using event macro 58 and no luck  :(. We have backpacks on my shard that can hold a 60k stack of one item so i'm trying to set that container as the container to look in but have it universal for everyone and just not specific to me. We can apply bandages to ourselves even if they're not in our "main" backpack.
"You miss 100% of the shots you don't take" - Wayne Gretzky

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +272
  • Referrals: 1
    • View Profile
Re: Having problems using last target
« Reply #3 on: May 04, 2014, 08:20:02 PM »
0
Code: [Select]
  repeat
    {
      set #targcurs 1   
    }
  until #targcurs = 0

This Bit Above Won't give you very consistent Results. What you are literally doing is forcing a target cursor 10x a second. So if you click something and it isn't right at the "Until #Targcurs = 0" Then it will just spit out another Cursor.

Code: [Select]
set #targcurs 1
While #targcurs = 1
wait 1

or

Code: [Select]
set #targcurs 1
Repeat
wait 1
Until #Targcurs = 1


That will help you with the container portion.
Brackets are also redundant inside of Repeat Untils, but they don't hurt anything for them to be there.

I also don't see you setting %Container in the sub itself.

Code: [Select]
  repeat
    {
      set #targcurs 1
    }
  until #targcurs = 0
  set #ltargetid %container
  set #ltargetkind 1
  event macro 22 0

After you get the #Targcurs = 0, you are probably wanting to set the %Container to the #ltargetid

Code: [Select]
set #targcurs 1
Repeat
wait 1
Until #Targcurs = 1
set %Container #ltargetid
set #ltargetid %container
set #ltargetkind 1
event macro 22 0
wait 20 ;<- A delay so the container can actually open before you check for bandages.
; Plenty of Coders have Subs for waiting for Things to happen like containers opening you can steal that are more reliable
; Than random Delays.

Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline Grandewd

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Having problems using last target
« Reply #4 on: May 05, 2014, 09:13:15 PM »
0
Excellent examples of usage for both setting #targcurs and repeats... Very nice. ;)

Offline alaskanTopic starter

  • Jr. Member
  • **
  • Posts: 29
  • Activity:
    0%
  • Reputation Power: 1
  • alaskan has no influence.
  • Gender: Male
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: Having problems using last target
« Reply #5 on: May 08, 2014, 02:57:03 AM »
0
Code: [Select]
  repeat
    {
      set #targcurs 1   
    }
  until #targcurs = 0

This Bit Above Won't give you very consistent Results. What you are literally doing is forcing a target cursor 10x a second. So if you click something and it isn't right at the "Until #Targcurs = 0" Then it will just spit out another Cursor.

Code: [Select]
set #targcurs 1
While #targcurs = 1
wait 1

or

Code: [Select]
set #targcurs 1
Repeat
wait 1
Until #Targcurs = 1


That will help you with the container portion.
Brackets are also redundant inside of Repeat Untils, but they don't hurt anything for them to be there.

I also don't see you setting %Container in the sub itself.

Code: [Select]
  repeat
    {
      set #targcurs 1
    }
  until #targcurs = 0
  set #ltargetid %container
  set #ltargetkind 1
  event macro 22 0

After you get the #Targcurs = 0, you are probably wanting to set the %Container to the #ltargetid

Code: [Select]
set #targcurs 1
Repeat
wait 1
Until #Targcurs = 1
set %Container #ltargetid
set #ltargetid %container
set #ltargetkind 1
event macro 22 0
wait 20 ;<- A delay so the container can actually open before you check for bandages.
; Plenty of Coders have Subs for waiting for Things to happen like containers opening you can steal that are more reliable
; Than random Delays.


Sorry still new to writing for easyuo, i'm still a newbie in training lol. You answered my dilemma and helped me solve the issue of setting the target bag as the variable. The pause after opening the %container makes sense as well. I still have a lot to learn but I'm very grateful for all the helped I've received from everyone on here and who knows maybe one day I can get TM's stamp of approval on a script one day hehe. Well thank you very much good sir  :)
"You miss 100% of the shots you don't take" - Wayne Gretzky

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +272
  • Referrals: 1
    • View Profile
Re: Having problems using last target
« Reply #6 on: May 08, 2014, 10:45:15 AM »
0
No problem. that's what we are here for.
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Tags: