Some question with active quests

Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.

Moderator: Moderators

Message
Author
ShivaDagger
Noob
Noob
Posts: 3
Joined: 20 Sep 2013, 06:40
Noob?: Yes

Some question with active quests

#1 Post by ShivaDagger »

Hi all,

First problem:
I have the following code but I can never seem to use the $aaa variable for comparison.

Code: Select all

macro testcarat{
$aaa = subQuestActive(13042)
log $aaa
if ($aaa == 1) log success
}

sub subQuestActive{ 
   my ($inputID) = @_;   
   if ($::questList->{$inputID}->{active} == ""){
      return 0
   }
   return  1;
}
The result I get is:

Code: Select all

[macro log] 1
It only prints $aaa, but the if statement where $aaa == 1 never gets executed to print success.
I have tried using return "1" (with double quotes) if ($aaa == "1") but it never worked. I have also tried many other instances to try to get this to work but to no avail. Could someone please help?

Second problem:
I am trying to execute a relog if the console does not show "You are casting Teleport on yourself" after the line "Teleporting due to idle"
This is the code I have:

Code: Select all

automacro unstuck {
  console /Teleporting due to idle\n(?!You are casting Teleport on yourself)/
  call {
  	do relog
  }
}
I am doing a negative look ahead to see if "You are casting Teleport on yourself" appears right after the line "Teleporting due to idle", if there is no such line, call relog. This does not seem to work and would be grateful if anyone could shed some light.

ShivaDagger
Noob
Noob
Posts: 3
Joined: 20 Sep 2013, 06:40
Noob?: Yes

Re: Some question with active quests

#2 Post by ShivaDagger »

I have managed to solve problem #1, can anyone help with #2?

Post Reply