Author Topic: Sub issue  (Read 3281 times)

0 Members and 1 Guest are viewing this topic.

Offline KetchupTopic starter

  • Full Member
  • ***
  • Posts: 138
  • Activity:
    0%
  • Reputation Power: 3
  • Ketchup has no influence.
  • Respect: +18
  • Referrals: 0
    • View Profile
Sub issue
« on: December 10, 2015, 07:32:13 AM »
0
I have an issue with this sub setting off the sound (alarm) no matter what I try to edit, why does my alarm keep going off even though my %Alerts are not being triggered?

Basically I use lame 3.0 and have added this sub into it, except the alarm goes off constantly when I add more than 1 %Alert
Code: [Select]
set %ALERTS 3
set %ALERT1 Wiggles
set %ALERT2 Razor
set %ALERT3 Deathstar
set %stamPer ( #MAXSTAM * %stamPercMod ) / 100
set !jindex #jindex + 1
set %playerspotted #false

sub playercheck
     set !nextjinedxend #jindex
    if !jindex <= !nextjinedxend
    {
       for !ji !jindex !nextjinedxend
       {
           scanjournal !ji
           for %number 1 %alerts
           if %alert . %number in #journal
           {
                   set %playerspotted #true
                   break
           }
       }
       set !jindex !nextjinedxend + 1
    }
    if %playerspotted
    {
       while #true
       {
           sound alarm
       }
    }
    sleep 10
    return





Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Sub issue
« Reply #1 on: January 01, 2016, 10:23:17 AM »
0
The only error I can see is that the inner most For loop does not have { }   

Code: [Select]
set %ALERTS 3
set %ALERT1 Wiggles
set %ALERT2 Razor
set %ALERT3 Deathstar
set %stamPer ( #MAXSTAM * %stamPercMod ) / 100
set !jindex #jindex + 1
set %playerspotted #false

sub playercheck
    set !nextjinedxend #jindex
    if !jindex <= !nextjinedxend
      {
      for !ji !jindex !nextjinedxend
         {
           scanjournal !ji
           for %number 1 %alerts
            {
             if %alert . %number in #journal
                   {
                   set %playerspotted #true
                   break
                   }
           }
         }
       set !jindex !nextjinedxend + 1
       }
    if %playerspotted
      {
       while #true
       {
           sound alarm
       }
      }
    sleep 10
return
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."

Tags: