Author Topic: Heal & Warn  (Read 13221 times)

0 Members and 1 Guest are viewing this topic.

Offline xxcaptainxxTopic starter

  • Jr. Member
  • **
  • Posts: 47
  • Activity:
    0%
  • Reputation Power: 0
  • xxcaptainxx has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Heal & Warn
« on: August 13, 2008, 07:30:29 PM »
0
Well here it goes i know a lot of you are masters or close to it out there, but i have been working on this simple script for a spell and can't seem to get it to function properly, so i figured i would post it here for help and so everyone can get a chuckle :)......     Ohh yeah i don't know how to make one of the boxs to put it in so you can copy and all so i am just going to past it


;========================================
;Name: XxCaptainxX's Heal & Warn
;Author: XxCaptainxX
;Version: What comes befor beta?  :)
;========================================
mainloop:
gosub counter
gosub check
gosub heal
goto mainloop

;-------Counter-(Crosses-Fingers)--------
 sub counter
  finditem ZLF
   if #findkind <> -1
  {
   if #findStack <= 20
   {
     EVENT ExMsg #charID 3 33 You are Low on bandaids!$
   }

;-------Checker-(Maybe)------------------
 sub check
  If #hits < #maxHits
     return %true
    return %false
  }
;-------Heal-(hopefully)-----------------
  sub heal
  if #result %true
  finditem ZLF
  {
   if #findkind <> -1
  {
   set #lobjectId #findId
    event macro 17
    target 5s
    event macro 23
    wait 10s 8
   }
  return

Offline Tidus

  • Lazy
  • Administrator
  • *
  • *
  • Posts: 1291
  • Activity:
    0%
  • Reputation Power: 15
  • Tidus is working their way up.Tidus is working their way up.Tidus is working their way up.
  • Gender: Male
  • Mind Blown
  • Respect: +151
  • Referrals: 2
    • View Profile
    • Ultimate Apparel
Re: Heal & Warn
« Reply #1 on: August 13, 2008, 08:04:30 PM »
0
This is what i came up with off your script.  You need something to tell it that it is done healing and if needed to it will try to heal again. so i added

set %fullheal You_finish_applying_the
set %retry You_apply_the_bandages
set %lilheal You_heal_what_little_damage_your
set %tryagain That_being_is_not_damaged
set %wait You_must_wait_to_perform_another_action

to the first of the script

and this to the healing sub

repeat
{
wait 0
}
until %fullheal in #sysmsg || %lilheal in #sysmsg || %retry in #sysmsg || %tryagain in #sysmsg || %wait in #sysMsg

and i added my own healing sub that you can use if wanted.

and i changed your %true and %false  to #true #false


here is the completed version

Code: [Select]
;========================================
;Name: XxCaptainxX's Heal & Warn
;Author: XxCaptainxX
;Version: What comes befor beta?  Smiley
;========================================
set %fullheal You_finish_applying_the
set %retry You_apply_the_bandages
set %lilheal You_heal_what_little_damage_your
set %tryagain That_being_is_not_damaged
set %wait You_must_wait_to_perform_another_action
mainloop:
gosub counter
gosub check
gosub healtest
goto mainloop

;-------Counter-(Crosses-Fingers)--------
 sub counter
  finditem ZLF
   if #findkind <> -1
  {
   if #findStack <= 20
   {
     EVENT ExMsg #charID 3 33 You are Low on bandaids!$
   }
  }
;-------Checker-(Maybe)------------------
 sub check
  If #hits < #maxHits
     {
     return #true
     }
  return #false

;-------Heal-(hopefully)-----------------
  sub heal
  if #result #true
  finditem ZLF
  {
   if #findkind <> -1
  {
   set #lobjectId #findId
    event macro 17
    target 5s
    event macro 23
    repeat
    {
    wait 0
    }
    until %fullheal in #sysmsg || %lilheal in #sysmsg || %retry in #sysmsg || %tryagain in #sysmsg || %wait in #sysMsg
   }
  return
 
  sub healtest
  if #result #true
     {
     event macro 58
     repeat
     {
     wait 0
     }
     until %fullheal in #sysmsg || %lilheal in #sysmsg || %retry in #sysmsg || %tryagain in #sysmsg || %wait in #sysMsg
     }
  return
For those who have fought for it, freedom has a taste the protected will never know ~ Anonymous, Vietnam, 1968

Offline Ramses

  • Jr. Member
  • **
  • Posts: 42
  • Activity:
    0%
  • Reputation Power: 0
  • Ramses has no influence.
  • Respect: +11
  • Referrals: 1
    • View Profile
Re: Heal & Warn
« Reply #2 on: August 14, 2008, 10:48:18 AM »
0
Ohh yeah i don't know how to make one of the boxs to put it in so you can copy and all so i am just going to past it

To help you in the future,
a code box is made as follows:
"["code"]" (Do not use the " and no spaces) This starts your code box.

Paste all of your code and then to end you rcode box.

"["/code"]" (Again, do not use the " and no spaces)


:)
« Last Edit: August 14, 2008, 10:54:35 AM by TrailMyx »

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Heal & Warn
« Reply #3 on: August 14, 2008, 10:58:13 AM »
0
Just click the icon to get the code block.  Then just put your code in between the separators.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Cstalker

  • Google Slut
  • ScriptUO Beta Tester
  • ***
  • *
  • Posts: 179
  • Activity:
    0%
  • Reputation Power: 0
  • Cstalker has no influence.
  • Gender: Male
  • Respect: +9
  • Referrals: 0
    • View Profile
Re: Heal & Warn
« Reply #4 on: August 21, 2008, 05:30:16 AM »
0
One thing to remember when useing #finditem is to always check the #findkind. The way you are useing it it will find your aids in packs first and then on the ground. The problem is that if somone was to drop aids on the ground out of your reach it will mess the script up.

I would write the counter sub like this
Code: [Select]

sub counter
  finditem ZLF C_ , #backpackid
   if #findkind = 0 && #findstack <= 20
     EVENT ExMsg #charID 3 33 You are Low on bandaids!
  if #findkind = -1
     event exmsg #charid 3 33 You are out of bandaids!
return

At this point you could add in a bandaid restocking.

The same with the actual heal sub

Code: [Select]
;-------Heal-(hopefully)-----------------
  sub heal
  if #result #true
  finditem ZLF c_ , #backpackid
  {
   if #findkind = 0  ; -1 not found, 0 in a container, 1 on the ground
  {
   set #lobjectId #findId
    event macro 17
    target 5s
    event macro 23
    repeat
    {
    wait 0
    }
    until %fullheal in #sysmsg || %lilheal in #sysmsg || %retry in #sysmsg || %tryagain in #sysmsg || %wait in #sysMsg
   }
  return

Hope this helps you in your quest to become a master scripter.

Offline xxcaptainxxTopic starter

  • Jr. Member
  • **
  • Posts: 47
  • Activity:
    0%
  • Reputation Power: 0
  • xxcaptainxx has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Heal & Warn
« Reply #5 on: August 21, 2008, 06:56:17 AM »
0
thanks for that, i am not sure how to do the restock..  any chances you could give me a lead? :)  that and i want to add chiv in..  i have been looking at trails healing script but my eyes cross when i look at it to much :)

« Last Edit: August 21, 2008, 07:02:12 AM by xxcaptainxx »

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Heal & Warn
« Reply #6 on: August 21, 2008, 10:14:59 AM »
0

Hope this helps you in your quest to become a master scripter.

Hey good to see the Cstalker isn't stalking in the shadows anymore.  ;)
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Cstalker

  • Google Slut
  • ScriptUO Beta Tester
  • ***
  • *
  • Posts: 179
  • Activity:
    0%
  • Reputation Power: 0
  • Cstalker has no influence.
  • Gender: Male
  • Respect: +9
  • Referrals: 0
    • View Profile
Re: Heal & Warn
« Reply #7 on: August 22, 2008, 11:33:55 PM »
0
Restocking is easy. It depends on where you have your bandaids at
this is one of the subs i use for restocking,

Code: [Select]
;----------------------------------
;%1 Type or ID of the item to restock
;%2 the amount to grab
;%3 the container to grab from
;%4 the container to drop to
Sub Restock
Finditem %1 C_ , %3
if #findkind = 0 && #findstack >= %2
 {
  exevent drag #findid %2
  exevent dropc %4
  wait 10
  return true
 }
event exmsg #charid 3 0 You do not have enough of that item.
return false

then you just use

gosub restock XX XXX XXXXXX XXXXXX
where the xs are %1 thru %4 that are in the sub.

As far as adding chiv, you use use the event macros where you need them
« Last Edit: August 22, 2008, 11:35:26 PM by Cstalker »

Offline xxcaptainxxTopic starter

  • Jr. Member
  • **
  • Posts: 47
  • Activity:
    0%
  • Reputation Power: 0
  • xxcaptainxx has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Heal & Warn
« Reply #8 on: August 24, 2008, 09:59:55 AM »
0
i am kind of confused with the %'s do i just replace the % with id's like to grab?
or
gosub restock CLF 100 CJR QQk

???

Thanks

Offline talkmill

  • Jr. Member
  • **
  • Posts: 36
  • Activity:
    0%
  • Reputation Power: 0
  • talkmill has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: Heal & Warn
« Reply #9 on: August 24, 2008, 10:24:29 AM »
0
Almost :)

CLF, CJR and QQK are types, meaning a type of item. IDs define a certain item/stack etc.

%3 and %4 must be ids and not types.

So lets say your source container's id is XJUGKQD and your target container's id is BKMUSPD you can use:

gosub restock CLF 100 XJUGKQD BKMUSPD

An easy way to manually check an id is just to drag the item around and then check #LLIFTEDID in easyuo.

Offline xxcaptainxxTopic starter

  • Jr. Member
  • **
  • Posts: 47
  • Activity:
    0%
  • Reputation Power: 0
  • xxcaptainxx has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Heal & Warn
« Reply #10 on: August 24, 2008, 02:49:22 PM »
0
what if the bag is inside the bank
or if i wanted a cursor to come up so i could target bag or item?
« Last Edit: August 24, 2008, 02:53:03 PM by xxcaptainxx »

Offline Cstalker

  • Google Slut
  • ScriptUO Beta Tester
  • ***
  • *
  • Posts: 179
  • Activity:
    0%
  • Reputation Power: 0
  • Cstalker has no influence.
  • Gender: Male
  • Respect: +9
  • Referrals: 0
    • View Profile
Re: Heal & Warn
« Reply #11 on: August 24, 2008, 04:49:27 PM »
0
easy

Code: [Select]
event macro 1 0 Bank
wait 15
set #TARGCURS 1
event exmsg #charid 3 0 Target your bag now
repeat
  {
  wait 1
  }
until #TARGCURS = 0
Set %WhatBagYouWant #ltargetid

Offline xxcaptainxxTopic starter

  • Jr. Member
  • **
  • Posts: 47
  • Activity:
    0%
  • Reputation Power: 0
  • xxcaptainxx has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Heal & Warn
« Reply #12 on: August 24, 2008, 05:12:20 PM »
0
alas this will cause it to look right away once it runs out, so maybe i should make a like button or something for when i am at the bank and need the restock.  this silly thing just gets more and more complicated

Offline Nicar

  • Full Member
  • ***
  • Posts: 198
  • Activity:
    0%
  • Reputation Power: 0
  • Nicar has no influence.
  • Respect: +20
  • Referrals: 0
    • View Profile
Re: Heal & Warn
« Reply #13 on: August 24, 2008, 05:27:43 PM »
0
alas this will cause it to look right away once it runs out, so maybe i should make a like button or something for when i am at the bank and need the restock.  this silly thing just gets more and more complicated

Just remember, some of the folks helping out have made or had hands in making fully AFK gold farmers, to kill, heal, loot, bank and go back for more. So, yeah, can be overload, but they will also give you small steps

Offline Cstalker

  • Google Slut
  • ScriptUO Beta Tester
  • ***
  • *
  • Posts: 179
  • Activity:
    0%
  • Reputation Power: 0
  • Cstalker has no influence.
  • Gender: Male
  • Respect: +9
  • Referrals: 0
    • View Profile
Re: Heal & Warn
« Reply #14 on: August 24, 2008, 07:57:30 PM »
0
Ok i am kinda confused. What are you wanting to do exatly? Are you wanting to recall to the bank, unload your stuff, restock you if needed and continue on your way? You ask for code on how to bring up a target cursor and then use it to pick a bag. I was assumeing that you wanted that as part of your setup section of your script.

I just wrote my first fully auto leather gathering script and this is the basic jest of it

Code: [Select]
;-----------------------------------------------------------------------
; stuff you need to set to make script work RIGHT
;-----------------------------------------------------------------------
Set %beatle MAGK                       ; Id of your beetle
set %beatlepack UTFSZMD               ; pack inside of beetle
set %lootbag RHIJJND                   ; bag inside your backpack for loot
set %resourcebox CZANLMD               ; ID of secure within reach of homerune

set %heavyshit JJG_sto_pof_guf         ; items you want moved to the beetle
set %dropspot_runebookid ZFUEBRD       ; default runebook for drop location
set %hunted_runebookid BYLKBRD         ; default runebook for dungeon
set %magery false                      ; true = recall  false = sacred journey
set %healspell 202                     ; 28 = greater heal, 3 = Heal, 202 = Close Wounds

set %loot JJG_OZF_DEG_rwf_guf_sto_pof_TTO_GMF_OKF ; stuff you want to loot
set %the_hunted ih_FE_AE_uf_QE_AF_ye_XE_DF_CD_RGB_PGB_SGB_JD_gb   ; critters to kill
set %Evade_Critters ye_XE_DF_CD

;--------------------------------------------------------------------
set %knives CNF_GMH      ; tools use to cut corpses dagger_skinning knife_
set %VSwait 5            ; very short wait
set %MSwait 10           ; medium wait
set %LSwait 15           ; long wait
gosub setup
gosub Define_rail
gosub steed setup
;------------------------------
;Main loop
;------------------------------
start:
 gosub weightcheck
 gosub recall_to_spot %dropspot_runebookid
 gosub positionpacks
 gosub unloadall
 gosub recall_to_spot %hunted_runebookid
 gosub positionpacks
 gosub enter_level_1
  if %menu_check = start
   {
    for %i 1 %endspot
    {
     gosub remount
     gosub check_health
     gosub menu_check
     set %oldcharposx #charposx
     set %oldcharposy #charposy
     set %oldcharposz #charposz
     set %x %x . %i
     set %y %y . %i
     set %z %z . %i
     gosub Weightcheck
     gosub moveto_spot %x %y %z %oldcharposx %oldcharposy
     set %enemyfound false
     repeat
     {
      gosub kill
     }
     until %enemyfound = false
     set %corpsefound false
     repeat
     {
      gosub findcorpse
      gosub moveto_spot %x %y %z %oldcharposx %oldcharposy
      gosub check_health
      gosub kill
     }
     until %corpsefound = false
    }
 gosub leave_level_1
goto start

that is just the main loop, I have 21 other subs that handle the auto killing, moving, checking health, weight, mana, when to recall to unload, when to restock..... The list goes on.

this is the restock sub

Code: [Select]
Sub Supply_check
Finditem RWF C_ , #backpackid ; this is arrows
if #FINDSTACK < 100
 {
  set %tograb 300 - #FINDSTACK
  set #lobjectid %resourcebox
  wait %vSwait
  event macro 17 0
  wait %vSwait
  contpos 0 0
  wait %vSwait
  Finditem RWF C_ , %resourcebox
   IF #FINDSTACK >= %tograb
    {
     exevent drag #findid %tograb
     exevent dropc #backpackid
     wait %MSwait
    }
   Else
    {
     event exmsg #charid 3 70 Out of arrows
     halt
    }
 }
finditem ZLF C_ , #backpackid ; this is bandaids
if #findstack < 25
{
  set %tograb 100 - #FINDSTACK
  set #lobjectid %resourcebox
  wait %vSwait
  event macro 17 0
  wait %vSwait
  contpos 0 0
  wait %vSwait
  Finditem ZLF C_ , %resourcebox
   IF #FINDSTACK >= %tograb
    {
     exevent drag #findid %tograb
     exevent dropc #backpackid
     wait %MSwait
    }
   Else
    {
     event exmsg #charid 3 70 Out of arrows
     halt
    }
 }
return

As you can see in that sub, i search my pack for arrows and then if the amount of arrows are lower than 100 it will restock me back to 300 arrows. The same goes with the bandaids. You just need to make sure you have enough on you to make a complete round between what you are doing and your recalling to the bank.

The restocking code above is about the best I have come up with so it should give you a good start on how its done.

Tags: