Author Topic: Heal & Warn  (Read 13215 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
Re: Heal & Warn
« Reply #15 on: August 26, 2008, 06:26:39 AM »
0
well what i am doing now is learning different commands. but ultimately i want to make a healing script like TM's but i also want it to heal pets and maybe have a consicrate option

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 #16 on: August 26, 2008, 07:09:27 AM »
0
ok here is the restocker. but i set up the supply bag threw targeting int he initial setup when starting up script. i am not sure how to call upon it later in this sub
Code: [Select]
;------Restocker-(Kind-Of)----------------
;----------------------------------
;%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 CLF 100 (Here is the problem can i put "#lobjectid %secure" here?)  GQJTJMD  <----   LOOK AT THIS LINE!!!
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

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 #17 on: August 26, 2008, 07:30:06 AM »
0
Well, first of all, you dont want to post any ids, or use ids in code that you make public, they are character specific (traceable to those that know how (UO)) Anyways,

gosub restock CLF 100 %secure_id %drop_container_id


then in your code you posted, you would just have...

Sub Restock

nothing is after it.  You will pass the parameters when calling the sub, as above with the gosub line. this is how it is useful because later on you can call sub again, for different items and containers

gosub restock POF 1000000 %you %me

That would call your restock sub, take 1million gold from you and drop it to me

Another thing, after your exevent drag, you need a wait of atleast 10 in there

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 #18 on: August 26, 2008, 07:59:35 AM »
0
My big problem is setting up my resource bag so that it ask for it in the begining of the script and then will call it back when it is time to use it for the restock.   this is my code so far i understand it needs a bunch of work yet, but i dont feel i can move on till this gets figured out.  here is my script as of now

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
gosub setsecure
mainloop:
gosub counter
gosub check
gosub heal
gosub restock
goto mainloop
;-------Set-up-secure-pack---------------
 sub setsecure
display yesno Are you using your bank?$
if #dispRes = yes
{
nextCPos 25 500
msg Bank$
wait %short_delay
}
display OK Please target your supply container.$
wait %short_delay
set #targcurs 1
wait %short_delay
WaitTarget:
if #targcurs = 0
{
set %resourcebox #ltargetid
return
}
goto WaitTarget
return

;-------Counter-(Crosses-Fingers)--------
 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
;-------Checker-(Maybe)------------------
 sub check
  If #hits < #maxHits
     {
     return #true
     }
  return #false

;-------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
;------Restocker-(Kind-Of)----------------
Sub restock
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
    }
 }
return


if i do the restock with  my personal resource bag ID setup in it it works fine so i know it is just a problem of recalling my initial setup

p.s. be at the bank when you initialy start this up and have a bag with aids in it.
« Last Edit: August 26, 2008, 08:01:41 AM by xxcaptainxx »

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 #19 on: August 26, 2008, 08:21:40 AM »
0

Code: [Select]
;-------Set-up-secure-pack---------------
 sub setsecure
display yesno Are you using your bank?$
if #dispRes = yes
{
nextCPos 25 500
msg Bank$
wait %short_delay
}
display OK Please target your supply container.

wait %short_delay
    set #targcurs 1
    target
    while #targcurs = 1
      wait 0
    set %resourcebox #ltargetid


return

Ok, try having your secure sub to this.  Sorry I couldn't test anything, but, this should set it. I'm pressed on time, just about ready to leave for work, hope this helps then later someone else hopefully can help.

Also, when using   display   you do not need a "$" at the end of the line like you do when using   msg   to say something.

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 #20 on: August 26, 2008, 09:45:29 AM »
0
that didn't change anything it still won't open the bag and restock bandages...  this is really fustrating me :(

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 #21 on: August 26, 2008, 06:54:47 PM »
0
Ok, so lets take a look at this restock sub... and I'm looking at it on the fly, as I am posting it... 

Code: [Select]
;------Restocker-(Kind-Of)----------------
Sub restock
finditem ZLF C_ , #backpackid ; this is bandaids
if #findstack < 25
{
  set %tograb 100 - #FINDSTACK
  set #lobjectid %resourcebox
  wait %vSwait                       <---------- where are these defined?
  event macro 17 0
  wait %vSwait
  contpos 0 0
  wait %vSwait
  Finditem ZLF C_ , %resourcebox
   IF #FINDSTACK >= %tograb
    {
     exevent drag #findid %tograb
;       WAIT SOMETHING HERE              <--------------
     exevent dropc #backpackid
     wait %MSwait
    }
 }
return

And I just now see something, all of these waits, where are they defined?  If there's no waits defined, then, well, of course it's not restocking.

Couple of other things, code is code, can look close to others.. some the heal checks and such looks close to Tidus' (Why call it snow when I see Tidus posting it) Leather Farmer. Which uses something else that someone suggested (I want to say TrailMyx with the sys msg items to check for certain bandage notices). All is fine and dandy, we are in debug, and we all have to learn things, just make sure when starting to release if you get there, that we give credit where it's due... guess I'll check this again in morning see if anything helped.

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 #22 on: August 27, 2008, 07:12:56 AM »
0
but if you pull the restock sub all by it self and hard define what resource bag you want to use it works fine so i don't think it is a timing issue.

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 #23 on: August 27, 2008, 08:08:18 AM »
0
did you try the change to setting up the resource box that I listed?  I'm just wondering.

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 #24 on: August 27, 2008, 08:24:37 AM »
0
Quote
Couple of other things, code is code, can look close to others.. some the heal checks and such looks close to Tidus' (Why call it snow when I see Tidus posting it) Leather Farmer. Which uses something else that someone suggested (I want to say TrailMyx with the sys msg items to check for certain bandage notices). All is fine and dandy, we are in debug, and we all have to learn things, just make sure when starting to release if you get there, that we give credit where it's due... guess I'll check this again in morning see if anything helped.


When it comes to the name Snow... it is because that is where all my first coding came about.  I was known as snow to my guild and that is the only people i wrote scripts for. later as i moved to different shards and played different chars i became known as tidus.  So i kept the name snow for purposes of scripting even though my name on forums change.

On the sys messages i did write myself and was later edited in a script i saw with someone else.  I have those in some "private" scripts i have.  I gave them to him earlier in this debug.  Rightfully i can say that i may have picked up some things early on in my scripting career from EUO but however i do not remember the source.

With the restocker.  Check out the spined leather farmer and you will see my sub Stock.  I took this from XII and OMG's Miner and revamped it for bandages.  Any questions let me know. :)
« Last Edit: August 27, 2008, 08:26:46 AM by Tidus »
For those who have fought for it, freedom has a taste the protected will never know ~ Anonymous, Vietnam, 1968

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 #25 on: August 27, 2008, 08:25:01 AM »
0
yes i changed them to 10 just for testing purposes

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 #26 on: August 27, 2008, 08:41:08 AM »
0
this is the restocker code alone and of course i have it hard set to my resource bag here.  why will it not read the set i have in the script?

Restocker works like this..

Code: [Select]
set %resourcebox huyslmd
finditem ZLF C_ , #backpackid ; this is bandaids
if #findstack < 25
{
  set %tograb 100 - #FINDSTACK
  set #lobjectid %resourcebox
  wait 10
  event macro 17 0
  wait 10
  contpos 0 0
  wait %vSwait
  Finditem ZLF C_ , %resourcebox
   IF #FINDSTACK >= %tograb
    {
     exevent drag #findid %tograb
     exevent dropc #backpackid
     wait 5
    }
 }
return

This is the code to set up the resourcebox..  is there something wrong in here?


Code: [Select]
display yesno Are you using your bank?$
if #dispRes = yes
{
nextCPos 25 500
msg Bank
wait %short_delay
}
display OK Please target your supply container.

wait %short_delay
    set #targcurs 1
    target
    while #targcurs = 1
      wait 0
    set %resourcebox #ltargetid


return

did a syntax check and not sure what this means

Method count: 55
Command count: 55
*** Pass 1 - Label accounting:
*** Error - Braces not balanced. Imbalanced by: 1
Subroutine labels = 5
Tag labels = 1
7 Code block(s).
0 Warnings(s) encountered.
*** Pass 2 - Execution [SYNTAXCHECK]
1 Error(s) encountered.
« Last Edit: August 27, 2008, 08:52:46 AM by xxcaptainxx »

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 #27 on: August 27, 2008, 08:53:31 AM »
0
***EDITED***
Okay here is my Stocking sub out of the leather script.  Modified for your use though.


Code: [Select]
sub Stock

 



   _opensecure:
   if %banking = yes
{
event macro 1 0 Bank
wait 5
}
finditem %bandies C_ , #backpackid
      if #findstack <= 3
         {
         set %amount ( 100 - #findstack )
         set #lobjectid %container
         event macro 17 0
         wait 10
         finditem %bandies C_ , %container
         if #findkind = -1
            {
            display You are out of bandies and have no way to heal. Get some more bandies and start over.
            halt
            }
         exevent drag #findid %amount
         wait 5
         exevent dropc #backpackid
         }
      }
wait 10
gosub TM_TravelFromRuneBook %travel %currentposition %currentposition %yourrunebook
Return


The main thing about this in comparison to yours, is wait times and your drag and drop.


Basically I'm searching my backpack.  Then i search for my container. Then search for the items needed in container.  Then i drag and drop items in container.

Also to help with your set %tograb 100 - #findstack  i would make it like this  set %togram ( 100 - #findstack )  basically you are telling to do the equation first then make it set to %tograb


and this is how i would get my bank setup

Code: [Select]
Display yesno Are you at Bank?
if #dispRes = yes
{
set %banking yes
event macro 1 0 Bank
wait 5
if #conttype = IKF
   set %container #contid
}
if #dispRes = no
{
set %banking no
set #targcurs 1
    target
    while #targcurs = 1
      wait 0
    set %container #ltargetid
}

« Last Edit: August 27, 2008, 09:09:03 AM by Tidus »
For those who have fought for it, freedom has a taste the protected will never know ~ Anonymous, Vietnam, 1968

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 #28 on: August 27, 2008, 10:00:13 AM »
0
out of curiostity does it work for you, unfortunetly it is not working for me.

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 #29 on: August 27, 2008, 10:53:56 AM »
0
i am not sure, because i am at work. i had to write the code and edit it from there.  Another problem you have to remember.. we don't know what freeshard you play.  We don't know the mechanics of it.  So it just might not work the way we think it should.
For those who have fought for it, freedom has a taste the protected will never know ~ Anonymous, Vietnam, 1968

Tags: