Author Topic: Ketchup's Saucy Veternary Trainer  (Read 5854 times)

0 Members and 1 Guest are viewing this topic.

Offline KetchupTopic starter

  • Full Member
  • ***
  • Posts: 138
  • Activity:
    0%
  • Reputation Power: 3
  • Ketchup has no influence.
  • Respect: +18
  • Referrals: 0
    • View Profile
Ketchup's Saucy Veternary Trainer
« on: June 28, 2015, 05:03:09 AM »
0
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


There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
Ketchup's Saucy Veternary V1.1.txt
« Last Edit: July 03, 2015, 07:29:23 AM by Ketchup »

Offline Ultimafreak77

  • Full Member
  • ***
  • Posts: 105
  • Activity:
    0%
  • Reputation Power: 2
  • Ultimafreak77 has no influence.
  • Gender: Male
  • Respect: +14
  • Referrals: 0
    • View Profile
Re: Ketchup's Saucy Veternary Trainer
« Reply #1 on: July 03, 2015, 03:12:20 AM »
0
Cool! I am still trying to get one of my scripts polished enough that I can post it here.
The few. The proud. The AFK.

Offline KetchupTopic starter

  • Full Member
  • ***
  • Posts: 138
  • Activity:
    0%
  • Reputation Power: 3
  • Ketchup has no influence.
  • Respect: +18
  • Referrals: 0
    • View Profile
Re: Ketchup's Saucy Veternary Trainer
« Reply #2 on: July 03, 2015, 04:38:14 AM »
0
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!

Offline Crisis

  • Global Moderator
  • *
  • *
  • Posts: 3015
  • Activity:
    3.4%
  • 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: Ketchup's Saucy Veternary Trainer
« Reply #3 on: July 03, 2015, 05:49:04 AM »
0
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.

Code: [Select]
;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 :)

Offline KetchupTopic starter

  • Full Member
  • ***
  • Posts: 138
  • Activity:
    0%
  • Reputation Power: 3
  • Ketchup has no influence.
  • Respect: +18
  • Referrals: 0
    • View Profile
Re: Ketchup's Saucy Veternary Trainer
« Reply #4 on: July 03, 2015, 07:22:37 AM »
0
perfect, thanks sir, I'll update it now! that makes sense!

Offline KetchupTopic starter

  • Full Member
  • ***
  • Posts: 138
  • Activity:
    0%
  • Reputation Power: 3
  • Ketchup has no influence.
  • Respect: +18
  • Referrals: 0
    • View Profile
Re: Ketchup's Saucy Veternary Trainer
« Reply #5 on: July 03, 2015, 07:25:19 AM »
0
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.

Code: [Select]
;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

Offline Crisis

  • Global Moderator
  • *
  • *
  • Posts: 3015
  • Activity:
    3.4%
  • 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: Ketchup's Saucy Veternary Trainer
« Reply #6 on: July 03, 2015, 09:23:22 AM »
0
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

Offline KetchupTopic starter

  • Full Member
  • ***
  • Posts: 138
  • Activity:
    0%
  • Reputation Power: 3
  • Ketchup has no influence.
  • Respect: +18
  • Referrals: 0
    • View Profile
Re: Ketchup's Saucy Veternary Trainer
« Reply #7 on: July 06, 2015, 07:53:08 AM »
0
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

Offline KetchupTopic starter

  • Full Member
  • ***
  • Posts: 138
  • Activity:
    0%
  • Reputation Power: 3
  • Ketchup has no influence.
  • Respect: +18
  • Referrals: 0
    • View Profile
Re: Ketchup's Saucy Veternary Trainer
« Reply #8 on: July 06, 2015, 08:01:45 AM »
0
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?
Code: [Select]
;=================================================================
; 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



« Last Edit: July 06, 2015, 08:10:45 AM by Ketchup »

Tags: