Author Topic: my first macro doesn't repeat  (Read 6925 times)

0 Members and 1 Guest are viewing this topic.

Offline ggnormkTopic starter

  • Restricted
  • *
  • Posts: 1
  • Activity:
    0%
  • Reputation Power: 1
  • ggnormk has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
my first macro doesn't repeat
« on: November 27, 2014, 04:51:56 AM »
0
Hi.

Here is my poisoning macro,
it is not repeat. Please help me

useskill 'Poisoning'
waitfortarget 15000
targettype! 0xf0a 0x0 'backpack'
target! 0x400cf57d
waitfortarget 15000
target! 0x40020989
return




Offline Crisis

  • Global Moderator
  • *
  • *
  • Posts: 3015
  • Activity:
    3.6%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +206
  • Referrals: 2
    • View Profile
Re: my first macro doesn't repeat
« Reply #1 on: November 27, 2014, 08:03:49 AM »
0
Happy Thanksgiving! (If you celebrate it that is)

You may want to go here and introduce yourself http://www.scriptuo.com/index.php?board=20.0

A member will likely get more help than someone that is restricted. I do not use steam so I am afraid that I cannot help you. That being said, this site has some nice EUO poisoning scripts for its members.  ;D

Offline Vlek

  • Jr. Member
  • **
  • Posts: 35
  • Activity:
    0%
  • Reputation Power: 1
  • Vlek has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
    • Bloodclan Orcs
Re: my first macro doesn't repeat
« Reply #2 on: November 19, 2015, 09:51:44 AM »
0
I know this is almost a year old, but for anyone that stumbles across this post might find this information helpful if they're also stuck.

There are two ways to loop in UOSteam, you can use the "loop" checkmark in the script tab (not recommended), or you can do for or while loops (recommended). In this case, you want to perform your poisoning until it is the case that you're either dead (can't gain or perform actions while you're dead), or you have gained 100 poisoning (No need to waste any materials after that). There are of course other cases where we'd want to quit our loop, like if we don't have anymore poison potions, but we can use the "break" statement for that.

Another point is that, instead of hardcoding serial numbers, it's more helpful to use promptalias to have the player target what they want to use. This allows the script to be used universally between characters without being changed.

The version you presented is also only able to deal with that specific poisoning potion. You may want to include the different poisoning potions by searching for specific ones using the findtype nested within an if statement with all of the different poisoning levels. You'd want to only include the poison potion selection part inside the if statement as everything else remains the same.

Our code then would look something like this:
Code: [Select]
//Example Poisoning Trainer by Vlek, Leader of the Bloodskulls
promptalias 'objtopoison'
if not @findalias 'objtopoison'
  sysmsg 'Please restart the script and select an item to poison'
  stop
endif
while not dead and skill 'poisoning' < 100
  useskill 'poisoning'
  waitfortarget 15000
  //This is only good for THIS specific poison level.
  //You either have to change it manually, or make your
  //script smarter to determine which to use based on your
  //poisoning skill level. (if skill 'poisoning' < 50), etc.
  targettype! '0xf0a' 'any' 'backpack'
  waitfortarget 15000
  target! 'objtopoison'
  pause 750
endwhile


Tags: