Author Topic: Failing Hard  (Read 241 times)

0 Members and 1 Guest are viewing this topic.

Offline chasemac140Topic starter

  • Jr. Member
  • **
  • Posts: 18
  • Activity:
    0%
  • Reputation Power: 1
  • chasemac140 has no influence.
  • Gender: Male
  • Respect: +1
  • Referrals: 0
    • View Profile
Failing Hard
« on: September 07, 2018, 08:16:43 PM »
0
So I read through these scripting tutorials.

I can't get my script to work. I even scrapped it and just copy and pasted his tutorial script for healing on F10. Got no where. Here was my initial script trying to make my guy just auto heal when lower than 90 HP.

;==============================================================
; Chase's Auto Healer
; version 1.0
; Shard OSI
; Purpose: AFK healing while being attacked by sheep
; Globals none
;==============================================================


;==========================Setup===============================
set %healpotHP ( #maxHits - 80 ) ; change this for how many points down to drink your heal pot
set %healbandagesHP ( #maxHits - 10 ) ; change this for how many points down to bandage yourself.
;=========================Main Loop============================

SUO:
repeat

onhotkey F10
   gosub UseBandage
if c in #charstatus
   gosub DrinkIt NUF

if #hits < %healbandagesHP && #sCnt > %timer_bandages_heal
   {
      gosub UseBandage
      set %timer_bandages_heal ( #sCnt + 60 )
   }

if #hits < %healpotHP && #sCnt > %timer_pot_heal
   {
      gosub DrinkIt UUF
      set %timer_pot_heal ( #sCnt + 10 )
   }
until #CharGhost = Yes
while #CharGhost = Yes
   wait 0
GoTo SUO







;===========================Subs=================================
sub UseBandage
   findItem ZJF C_ , #backpackID
      if #findkind = -1
         return
   set #lobjectID #findID
   set #ltargetKind 1
   event macro 17 0
   target 3
   event macro 23 0
   wait 5
Return

sub DrinkIt
   namespace push
   namespace local DIT ; short for DrinkIt
   finditem %1 C_ , #backpackID
      if #findkind = -1
         return
   set #lobjectID #findID
   set #ltargetKind 1
      event macro 17 0
      wait 5
   namespace clear
   namespace pop
Return


Can someone pick this apart and show me where I've been stupid or just not paid close enough attention?   

update. I know the sub is being called. Just to test I added

onhotkey F10
gosub HealME


then in the sub I added

display Hello there!

the message pops up on the screen just fine. Its like it cant use the event macros or doesnt recognize the itemtype.    
« Last Edit: September 07, 2018, 08:34:45 PM by chasemac140 »

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5270
  • Activity:
    0.2%
  • Reputation Power: 59
  • Endless Night is leading the good life!Endless Night is leading the good life!Endless Night is leading the good life!Endless Night is leading the good life!Endless Night is leading the good life!Endless Night is leading the good life!Endless Night is leading the good life!Endless Night is leading the good life!Endless Night is leading the good life!Endless Night is leading the good life!Endless Night is leading the good life!
  • Respect: +386
  • Referrals: 1
    • View Profile
Re: Failing Hard
« Reply #1 on: September 08, 2018, 04:04:13 PM »
0
do you have your backpack open.
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline chasemac140Topic starter

  • Jr. Member
  • **
  • Posts: 18
  • Activity:
    0%
  • Reputation Power: 1
  • chasemac140 has no influence.
  • Gender: Male
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Failing Hard
« Reply #2 on: September 09, 2018, 07:21:51 AM »
0
yea, its open. I think. Hold on gonna go try again.

Yea no dice, it doesnt work.

;==============================================================
; Chase's Auto Healer
; version 1.0
; Shard OSI
; Purpose: AFK healing while being attacked by sheep
; Globals none
;==============================================================


;==========================Setup===============================
set %healpotHP ( #maxHits - 80 ) ; change this for how many points down to drink your heal pot
set %healbandagesHP ( #maxHits - 10 ) ; change this for how many points down to bandage yourself.
;=========================Main Loop============================

SUO:
repeat

onhotkey F10
   gosub UseBandage
if c in #charstatus
   gosub DrinkIt NUF

if #hits < %healbandagesHP && #sCnt > %timer_bandages_heal
   {
      gosub UseBandage
      set %timer_bandages_heal ( #sCnt + 60 )
   }

if #hits < %healpotHP && #sCnt > %timer_pot_heal
   {
      gosub DrinkIt UUF
      set %timer_pot_heal ( #sCnt + 10 )
   }
until #CharGhost = Yes
while #CharGhost = Yes
   wait 0
GoTo SUO







;===========================Subs=================================
sub UseBandage
   findItem ZJF C_ , #backpackID
      if #findkind = -1
         return
   set #lobjectID #findID
   set #ltargetKind 1
   event macro 17 0
   target 3
   event macro 23 0
   wait 5
Return

sub DrinkIt
   namespace push
   namespace local DIT ; short for DrinkIt
   finditem %1 C_ , #backpackID
      if #findkind = -1
         return
   set #lobjectID #findID
   set #ltargetKind 1
      event macro 17 0
      wait 5
   namespace clear
   namespace pop
Return

Offline Trigs

  • Jr. Member
  • **
  • Posts: 22
  • Activity:
    0%
  • Reputation Power: 1
  • Trigs has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Failing Hard
« Reply #3 on: September 10, 2018, 10:55:29 AM »
0
Nothing stands out at a quick glance

It's usually really helpful to step through the code to see what's not working. With the code stopped, you can hit F7 or F8 to step through the code line by line, one of them will "step in" to subs and follow the code, the other will just call the sub.

So while your char is damaged, and you have the EUO window up / focused you could hit F8 F8 F8 and walk through the code line by line, you should be able to logic mistakes or calls that are not working as intended.

I'll try to remember to test it out at home tonight
« Last Edit: September 10, 2018, 10:57:03 AM by Trigs »

Offline chasemac140Topic starter

  • Jr. Member
  • **
  • Posts: 18
  • Activity:
    0%
  • Reputation Power: 1
  • chasemac140 has no influence.
  • Gender: Male
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Failing Hard
« Reply #4 on: September 10, 2018, 08:02:56 PM »
0
I appreciate it, Ill do this tomorrow.

Tags: