ScriptUO
Official ScriptUO EasyUO Scripts => Submit your Script => Topic started by: Ketchup on June 28, 2015, 05:03:09 AM
-
Please be gentle, here is my first written script that I've actually ever got semi working, I plan to keep this updated and try to build on the basics I have here! I need to learn somehow!
Anyway!
Setup Instructions:
1) Have a backpack full of normal bandages
2) Have 2 identical tamed animals, preferably something with high hit points that hits little damage, I prefer cows
3) Target the actual animal and not it's hit point bar, for now (plan to be fixed)
Known issues that I may need help with:
1) Sometimes the pet may die, I'm unsure how to go about ignoring the timer if a pet doesn't need to be healed, for example if it's full health
2) If you run out of bandages, no scripted way to get more
-
Cool! I am still trying to get one of my scripts polished enough that I can post it here.
-
I wouldn't really call this polished haha, so many things I'd like it to do I just have no idea how to go about them, one thing that's really bugging me is how after selecting the animals HP bar,s to get them not to move so that I can click animals 2 HP bar, if anyone can offer advice that would help me!
-
You will find that timing is extremely important in scripting, whether it is a simple task like choosing animals or more complex like during crafting. You did not put any wait in after selecting your animals to heal so after selecting the first one it is immediately trying to select the second.
I added Wait 20 in two spots and it works like how you want it.
;Setup
display Please Target Your First Animal$
set #targcurs 1
repeat
until #targcurs = 0
set %animal1 #ltargetid
wait 20
display Please Target Your Second Animal$
set #targcurs 1
repeat
until #targcurs = 0
wait 20
set %animal2 #ltargetid
wait 20
Script works nice :)
-
perfect, thanks sir, I'll update it now! that makes sense!
-
You will find that timing is extremely important in scripting, whether it is a simple task like choosing animals or more complex like during crafting. You did not put any wait in after selecting your animals to heal so after selecting the first one it is immediately trying to select the second.
I added Wait 20 in two spots and it works like how you want it.
;Setup
display Please Target Your First Animal$
set #targcurs 1
repeat
until #targcurs = 0
set %animal1 #ltargetid
wait 20
display Please Target Your Second Animal$
set #targcurs 1
repeat
until #targcurs = 0
wait 20
set %animal2 #ltargetid
wait 20
Script works nice :)
Crisis can you tell me why there is one wait after until #targcurs = 0 is one but not in the other, just would like to know the reasoning behind this
-
Because I was about to leave when I fixed it and I was rushing and added it wrong but forgot to remove it. DOH! That needs to come out.
See what I mean about timing? :o
-
yeah that works so much better, thanks for the advice! have you got an example of how I would work an IF statement into it? the reason I ask is because I want "this being is not damaged" to skip the timer and heal the next pet right away
On my noobie scripting knowledge I guess I'd have to seperate the healing of each animal into subs and put gosub animal1 and go sub animal 2 into the main loop and then put an if statement (not sure how to really do this) that is that it said it would gosub animal 2 or vice versa
-
Okay, I THINK I made it more friendly for adding IF statements into each sub but unsure on how adding the IF "This being is not damaged" gosub animal 2, off the top of my head is it something to do with #SYSMSG?
;=================================================================
; Script Name: Ketchups Quick And Easy Veternary
; Author: Ketchup
; Version: 1
; Shard OSI
; Revision Date: 03/7/15
; Purpose: Trains veterinary by quickly healing any 2 pets
; Requirements:
; 0) A backpack full of bandages
; 1) 2 equal animals, I found cows are the best!
; 2) Guilded in Tram or Fel
;Setup
display Please Target Your First Animal$
set #targcurs 1
repeat
until #targcurs = 0
set %animal1 #ltargetid
wait 20
display Please Target Your Second Animal$
set #targcurs 1
repeat
until #targcurs = 0
set %animal2 #ltargetid
wait 20
msg all guard me$
wait 20
msg all kill$
set #ltargetid %animal1
target
event macro 22
wait 20
main:
gosub animal1
gosub animal2
goto main
sub animal1
finditem ZLF C_
set #LOBJECTID #FINDID
set #LOBJECTID #FINDID
set #LTARGETID %animal1
event macro 17 0
target 5s
event macro 22 0
wait 40
return
sub animal2
set #LOBJECTID #FINDID
set #LTARGETID %animal2
event macro 17 0
target 5s
event macro 22 0
wait 40
return