Author Topic: A couple of questions about hiding  (Read 2965 times)

0 Members and 1 Guest are viewing this topic.

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 3015
  • Activity:
    3.6%
  • 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
A couple of questions about hiding
« on: December 27, 2013, 10:05:30 AM »
0
1. How script a check to see if your character is hidden? Only thing that I could really find is doing a check for a hidden flag on EUO. I want to add a hide option on a craft script but this would be used at a bank and hiding is low.

Code: [Select]
event macro 13 21
wait 11000

if H in #charStatus
{
gosub startcraft
}
return

Will this continue to try and hide until character is hidden and then move onto the crafting sub? If not, what am I doing wrong? Is there a better way to do this?

2. Using this meditation sub, where would I put in a hide event so that the character hides when meditation is done?

Code: [Select]
sub CheckMana
  menu delete scriptstatus
  Menu Font BGColor Black
  menu Font Color Lime
  menu text scriptstatus 95 100 Checking Mana
  set %_test ( 100 * #mana ) / #maxmana
  if ( %_test < 35 ) || ( #mana < %mana )
  {
    gosub actionblock
    menu delete scriptstatus
    Menu Font BGColor Black
    menu Font Color Lime
    menu text scriptstatus 95 100 Meditating
    event macro 13 46 ; meditate
    set %_tlastskill #systime + 10100
    while #mana < ( 95 * #maxmana / 100 )
    {
      gosub hardwait 1
      if %_tlastskill < #systime
      {
        gosub actionblock
        event macro 13 46 ; meditate
        set %_tlastskill #systime + 10200
      }
    }
    set %_diff #systime - %_tlastskill - 9000
    if %_diff > 0
    {
      set %_diff ( %_diff / 50 ) + 1
      gosub hardwait %_diff
    }
  }
return

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
Re: A couple of questions about hiding
« Reply #1 on: December 27, 2013, 10:21:17 AM »
0
1. How script a check to see if your character is hidden? Only thing that I could really find is doing a check for a hidden flag on EUO. I want to add a hide option on a craft script but this would be used at a bank and hiding is low.

Code: [Select]
event macro 13 21
wait 11000

if H in #charStatus
{
gosub startcraft
}
return

Will this continue to try and hide until character is hidden and then move onto the crafting sub? If not, what am I doing wrong? Is there a better way to do this?
I do this in a number of scripts, here is an example using the mainloop from my Cart trainer:

Code: [Select]
;Start Mainloop
repeat
   gosub XIIxSkillCheck Cart %StartSkill
   set %CurrentSkill #RESULT
   gosub SetMap %CurrentSkill
   set %CurrentMap #RESULT
   gosub XIIxMaxWeight 0
   set %ScrollAmount #RESULT - #WEIGHT
   
   while %ToHide = yes && H notin #CHARSTATUS
      {
      event macro 13 21
      wait 11s ;<------ you can skip this if you don't plan to use another skill afterward
      }

   gosub CartCraft
   gosub TrashMap

   if #menubutton = Pause
      gosub XIIxPause
until #FALSE
; End Mainloop

In this particular example I set a veriable %ToHide in the setup portion but you should still get the point. The idea is to deal with hiding before moving on to the rest of the logic (in the setup subs I don't even give the user the option to try hiding if the skill is less than 20 unless they are human).

Quote
Code: [Select]
2. Using this meditation sub, where would I put in a hide event so that the character hides when meditation is done?

Don't do it in the sub, do it after you return from the sub.

X
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 3015
  • Activity:
    3.6%
  • 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: A couple of questions about hiding
« Reply #2 on: December 27, 2013, 10:35:06 AM »
0
1. How script a check to see if your character is hidden? Only thing that I could really find is doing a check for a hidden flag on EUO. I want to add a hide option on a craft script but this would be used at a bank and hiding is low.

Code: [Select]
event macro 13 21
wait 11000

if H in #charStatus
{
gosub startcraft
}
return

Will this continue to try and hide until character is hidden and then move onto the crafting sub? If not, what am I doing wrong? Is there a better way to do this?
I do this in a number of scripts, here is an example using the mainloop from my Cart trainer:

Code: [Select]
;Start Mainloop
repeat
   gosub XIIxSkillCheck Cart %StartSkill
   set %CurrentSkill #RESULT
   gosub SetMap %CurrentSkill
   set %CurrentMap #RESULT
   gosub XIIxMaxWeight 0
   set %ScrollAmount #RESULT - #WEIGHT
   
   while %ToHide = yes && H notin #CHARSTATUS
      {
      event macro 13 21
      wait 11s ;<------ you can skip this if you don't plan to use another skill afterward
      }

   gosub CartCraft
   gosub TrashMap

   if #menubutton = Pause
      gosub XIIxPause
until #FALSE
; End Mainloop

In this particular example I set a veriable %ToHide in the setup portion but you should still get the point. The idea is to deal with hiding before moving on to the rest of the logic (in the setup subs I don't even give the user the option to try hiding if the skill is less than 20 unless they are human). Ok so the script will continue to try while h is not in the character status? What does the && do?

Quote
Code: [Select]
2. Using this meditation sub, where would I put in a hide event so that the character hides when meditation is done?

Don't do it in the sub, do it after you return from the sub. I tried doing it at the beginning of my crafting sub but I did it worng or something because it would try and hide after each craft attempt

X


I replied in your quote usung red  :D

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: A couple of questions about hiding
« Reply #3 on: January 07, 2014, 07:18:20 AM »
0
Quote
In this particular example I set a veriable %ToHide in the setup portion but you should still get the point. The idea is to deal with hiding before moving on to the rest of the logic (in the setup subs I don't even give the user the option to try hiding if the skill is less than 20 unless they are human). Ok so the script will continue to try while h is not in the character status? What does the && do?

The && means that both conditions have to be met before it will go into the if statement.
So while %ToHide = yes && H notin #CHARSTATUS  means that %ToHide has to be yes and H cannot be in the #charstatus in order for it to run the if statement.

Quote
Don't do it in the sub, do it after you return from the sub. I tried doing it at the beginning of my crafting sub but I did it worng or something because it would try and hide after each craft attempt

you need to write your hide in an if statement if it is in your med sub or even after your med sub.   This was shown by XII. This is a while loop that runs under that condition.  Basically it is the same as an if statement in how it is used.
Code: [Select]
   while %ToHide = yes && H notin #CHARSTATUS
      {
      event macro 13 21
      wait 11s ;<------ you can skip this if you don't plan to use another skill afterward
      }

For those who have fought for it, freedom has a taste the protected will never know ~ Anonymous, Vietnam, 1968

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
Re: A couple of questions about hiding
« Reply #4 on: January 07, 2014, 08:42:47 AM »
0
Jeeze, I never saw that reply last week Crisis, sorry. Thanks for the fill in Tidus!!
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Tags: