Author Topic: How to exit out of a cure sub when mob is found.  (Read 2851 times)

0 Members and 1 Guest are viewing this topic.

Offline vanzelusTopic starter

  • Jr. Member
  • **
  • Posts: 24
  • Activity:
    0%
  • Reputation Power: 1
  • vanzelus has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
How to exit out of a cure sub when mob is found.
« on: January 08, 2014, 05:56:03 PM »
0
Hi,

This is my followup from the last thread on the cure sub but it's a different issue so I went ahead and make a new thread.  Thank you to all those who helped me in that thread.

Anyway, I have my cure sub as follow, which is called from the health check sub:

Code: [Select]
Sub Cast_Cure
  Repeat
    If C In #Charstatus && G Notin #Charstatus && #Mana >= 25 && %Cast_Wait_Timer <= #sCnt2
    {
      Event macro 15 201 ; cast Chiv spell cleanse by fire
      Target 5s
      Event macro 23 0 ; target self
      Set %Cast_Wait_Timer #sCnt2 + 20
    }
  Until C Notin #Charstatus || Finditem %KILLS G_8
Return

So the gist of it is that once the char is out of combat and is poisoned, the sub will try to cure repeatedly (especially if it's deadly poison or failed, but I have protection on so the second issue is not a problem).  Now, what am trying to do is have the sub exit out when the script scans and finds a mob, which is defined by Finditem %kills G_8 where %kills is the variable where all the mob types are defined.  My question is, is the last part written as it is will allow me to exit out of the sub when the mob is found even if my char is not cured?:

Code: [Select]
Until C Notin #Charstatus || Finditem %KILLS G_8
Return

He's a sampire and I only worry about cure poison (deadly specifically because vampire form doesn't auto cure) when he's out of combat and not leeching health, hence the cure sub and the need to exit out of the cure sub when mob respawns.  Thank you for your inputs
« Last Edit: January 08, 2014, 06:00:56 PM by vanzelus »

Offline Alpha

  • Hero Member
  • *
  • Posts: 583
  • Activity:
    0%
  • Reputation Power: 10
  • Alpha barely matters.Alpha barely matters.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: How to exit out of a cure sub when mob is found.
« Reply #1 on: January 08, 2014, 06:07:35 PM »
0
Code: [Select]
Sub Cast_Cure
  Repeat
    If C In #Charstatus && G Notin #Charstatus && #Mana >= 25 && %Cast_Wait_Timer <= #sCnt2
    {
      Event macro 15 201 ; cast Chiv spell cleanse by fire
      Target 5s
      Event macro 23 0 ; target self
      Set %Cast_Wait_Timer #sCnt2 + 20
      Finditem %Kills G_ 8   ;-- Scans for Monsters of type defined by %Kills withing 8 tiles on Ground.
    }
  Until C Notin #Charstatus || #Findcnt > 0    ;---   #findcnt updates to the info from the above "finditem" and if something is found the "Until" Exits...
Return

Offline vanzelusTopic starter

  • Jr. Member
  • **
  • Posts: 24
  • Activity:
    0%
  • Reputation Power: 1
  • vanzelus has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: How to exit out of a cure sub when mob is found.
« Reply #2 on: January 08, 2014, 06:10:17 PM »
0
 :o ah that's what it is, no wonder why it was not working when I test it.  Thanks alpha  :).

Offline Alpha

  • Hero Member
  • *
  • Posts: 583
  • Activity:
    0%
  • Reputation Power: 10
  • Alpha barely matters.Alpha barely matters.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: How to exit out of a cure sub when mob is found.
« Reply #3 on: January 08, 2014, 06:43:52 PM »
0
Some other things that always helped me figure out what was going on in a script...

1) Set up your own variable list...   aka...  Select Tools --> Manage Variable list   or simply Variable Dump if you want to see the state of your variables at the time of the dump...  I often insert a pause at the appropriate place and then do a Var dump to check a certain variable.   With "Manage Variable list"   I'll do something like

\USER      which creates your own little "USER" section on the right panel of EUO window where all the variables are..   and then I'll simply add what variables I'm interested in...

\USER
%A
%B
%TEST

etc.....

2)  F7   !!!  Single stepping through a script.  I'll use a pause so that in longer scripts I can simply click play and it will pause at the right spot and then I can single step through stuff with F7 to see what's going on.   Hope that helps some if you already didn't know.

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: How to exit out of a cure sub when mob is found.
« Reply #4 on: January 08, 2014, 11:34:38 PM »
0
Will have to try  Select Tools  really soon and learn how to use it. 

Offline vanzelusTopic starter

  • Jr. Member
  • **
  • Posts: 24
  • Activity:
    0%
  • Reputation Power: 1
  • vanzelus has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: How to exit out of a cure sub when mob is found.
« Reply #5 on: January 09, 2014, 06:29:40 AM »
0
Some other things that always helped me figure out what was going on in a script...

1) Set up your own variable list...   aka...  Select Tools --> Manage Variable list   or simply Variable Dump if you want to see the state of your variables at the time of the dump...  I often insert a pause at the appropriate place and then do a Var dump to check a certain variable.   With "Manage Variable list"   I'll do something like

\USER      which creates your own little "USER" section on the right panel of EUO window where all the variables are..   and then I'll simply add what variables I'm interested in...

\USER
%A
%B
%TEST

etc.....

2)  F7   !!!  Single stepping through a script.  I'll use a pause so that in longer scripts I can simply click play and it will pause at the right spot and then I can single step through stuff with F7 to see what's going on.   Hope that helps some if you already didn't know.

Now I do, thanks :)

Tags: