Official ScriptUO EasyUO Scripts > Script Debug

auto gheal pot

(1/2) > >>

txixux:
I'M trying to make my "own" (i read a lot of macros that make the same and take the best for me of each)  autoheal script, but I'm not good at all scripting, my question is why this script doesn't work?

  event macro 24 1
  finditem UUF C_ , #backpackid
  set #lobjectid #findid
  event macro 17
  wait 20
  event macro 37

I'M trying to make my macro disarm drink and arm, but it just disarm and arm  :-[

thank you

TrailMyx:
One thing that you will run into when disarm/rearm is that it's pretty slow using EasyUO.  So you need to put in safeguards to be sure you are doing it slow enough to not cause "you must waits".  Best thing for this is to put in checks to be sure you have completely disarmed, and the rearmed before allowing the code to continue.

Some recommendations I would make:

1) So when you disarm, put a loop that will wait until your armed weapon appears in your backpack
2) Put a check to see if you have any pots left; don't assume you have some
3) When you re-arm, put a loop in to be sure the weapon appears in your paperdoll.
4) After both disarm/rearm sequences, put an additional "'''wait" in and play with this value until you find something that works 100%.

So your psudocode would be:

0) check for pots, if none are available, no need to disarm; fail and warn of no pots
1) disarm
2) wait until disarm
2a) wait a bit more
3) check for pots
4) drink a pot since you know they are available
5) wait 20
6) rearm
7) wait for rearm
8 ) wait a bit more.

If you do this, then you should have a pretty lag-independent way of chugging.


I deliberately didn't code this for you.  If you still need help, I can post some code snippets.  I know some people like to try and figure it out for themselves.  So if you need some more info, just say so.  ;)

Cerveza:

--- Quote from: txixux on October 21, 2008, 07:31:28 AM ---I'M trying to make my "own" (i read a lot of macros that make the same and take the best for me of each)  autoheal script, but I'm not good at all scripting, my question is why this script doesn't work?

  event macro 24 1
  finditem UUF C_ , #backpackid
  set #lobjectid #findid
  event macro 17
  wait 20
  event macro 37

I'M trying to make my macro disarm drink and arm, but it just disarm and arm  :-[

thank you

--- End quote ---
TM's got it right. The problem is with lag and connection. If you just put in set delays, then it might work 80% of the time. But to make it work 100% you need to have checks.

Check to make sure weapon appears in pack, THEN drink.

If you just want a simple drinker then you can use delays. Remember it's not going to work 100%.


--- Code: ---event macro 24 1
wait 10 ; adjust this if needed
findItem UUF C_ , #backpackID
if #findKind = -1
  return
set #lobjectID #findID
set #ltargetKind 1
event macro 17 0
wait 5 ; adjust this if needed
event macro 37

--- End code ---

May I ask what you are holding that you need to disarm one hand? Whats in your off hand you don't want to disarm?

txixux:
thank you, I am gonna start working on it.



I just hold a xbow in my hand, i dont care if i disarm both hands, just that I just know how to do it with event macro 24 1  ::)

txixux:

Navigation

[0] Message Index

[#] Next page

Go to full version