How to check the console with an if statment?

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

Malboro
Noob
Noob
Posts: 12
Joined: 09 Jul 2012, 16:29
Noob?: No

How to check the console with an if statment?

#1 Post by Malboro »

Hey Guys, i want to check the Console with an if statment in a while statment.

is there any way? i checked the existing macros.
but all times console is only used on automacros.
but i need it in an while statment.

greetings
Malboro
iMikeLance
Moderators
Moderators
Posts: 208
Joined: 01 Feb 2010, 17:37
Noob?: No
Location: Brazil - MG

Re: How to check the console with an if statment?

#2 Post by iMikeLance »

Code: Select all

automacro checkConsole {
	console /(.*)/
	timeout 5
	exclusive 1
	call {
	while ($.lastMatch0 =~ /regexp/) as whileloop # read http://openkore.com/index.php/Macro_plugin#Conditions
		#blablabla
	end whileloop
	}
}
This should work.
Malboro
Noob
Noob
Posts: 12
Joined: 09 Jul 2012, 16:29
Noob?: No

Re: How to check the console with an if statment?

#3 Post by Malboro »

hey thanks for the replay, but sadly it doesnt works.

i am working with this while statement

Code: Select all

 while ($Count <= 100) as exampleloop
      do sl "Plant Cultivation" 170 44 1
      pause 0.5
      <this place#1>
	  do ss "Cart Revolution" 1
	  pause 0.5
      :noplant
      $Count++
   end exampleloop
i need a if statment to check the console if Plant Cultivation was successfull. if not, he shell jump to :noplant (which is "goto noplant").
but i dont get the if statment, i dont find something to check if the console gave me this information.
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: How to check the console with an if statment?

#4 Post by EternalHarvest »

You can't easily do that inside of a macro. Split it on several macros and put console text checks in automacro conditions.