Openkore.com

OpenKore Forums
It is currently 18 Oct 2018, 18:53

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Some question with active quests
PostPosted: 13 Sep 2016, 04:42 
Offline
Noob
Noob

Joined: 20 Sep 2013, 06:40
Posts: 3
Hi all,

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

Code:
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:
[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:
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.


Top
 Profile  
 
 Post subject: Re: Some question with active quests
PostPosted: 21 Sep 2016, 17:07 
Offline
Noob
Noob

Joined: 20 Sep 2013, 06:40
Posts: 3
I have managed to solve problem #1, can anyone help with #2?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group