cloak for safety

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

Moderator: Moderators

Message
Author
Astrologic
Noob
Noob
Posts: 3
Joined: 04 Jul 2011, 15:02
Noob?: No

cloak for safety

#1 Post by Astrologic »

You can see clearly what I'm trying to do.
However, when the portal is seen by the bot, it doesn't cloak.

automacro cloak1 {
console /Portal Exists: ra_fild08 -> ra_fild12 (165, 29) - (0)/
call cloak
timeout 60
}

automacro cloak2 {
console /Portal Exists: ra_fild08 -> ra_fild09 (368, 234) - (0)/
call cloakd
timeout 60
}

automacro cloak3 {
console /Portal Exists: ra_fild09 -> ra_fild08 (27, 238) - (0)/
call cloak
timeout 60
}

automacro cloak4 {
console /Portal Exists: ra_fild09 -> ra_fild05 (29, 343) - (0)/
call cloakd
timeout 60
}

macro cloak {
do ss 135
}
macro cloakd {
pause 3
do ss 135
}

cloakd is a delay before cloaking - so my assassin can get to the portal before uncloaking. This is supposed to allow me to cloak on my way to hill winds to avoid aggros on the maps prior to the hill wind map. I don't know exactly what's wrong, any help is highly appreciated.

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: cloak for safety

#2 Post by EternalHarvest »

Don't use regexp syntax for console condition if you're providing strings, not regexps.

Astrologic
Noob
Noob
Posts: 3
Joined: 04 Jul 2011, 15:02
Noob?: No

Re: cloak for safety

#3 Post by Astrologic »

Would you mind providing me an example of how this string should look? I'm not entirely sure what I'm doing here :S

Mushroom
Perl Monk
Perl Monk
Posts: 427
Joined: 04 Apr 2008, 14:04
Noob?: No
Location: Brazil

Re: cloak for safety

#4 Post by Mushroom »

When you use regex, you put them between //.

Code: Select all

Ex. console /regex syntax/
When you use the strings, the exact text to match, you put it between "".

Code: Select all

Ex. console "String to match. Case-sensitive"
Quit.

Rotary777
Noob
Noob
Posts: 4
Joined: 25 May 2014, 05:18
Noob?: No

Re: cloak for safety

#5 Post by Rotary777 »

Hey all.

Instead of creating a new thread I thought i would bump this one, as i am trying to achieve the same effect of my assassin cross being able to cloak in fields while walking to my lockmap.

Is using a macro the only way to do this? Can you not achieve the same result via a useselfskill setup in the config file?

If marco is the only way to do it, will i need a separate macro for each different path for different lock maps? for example if i choose morroc field 17 and setup each morroc field warp co-ordinates will i have to setup a separate macro if i choose to change my lockmap to a Rachel field?

otaku
Human
Human
Posts: 28
Joined: 29 Nov 2013, 21:50
Noob?: No
Location: Brazil
Contact:

Re: cloak for safety

#6 Post by otaku »

If you do it like Astrologic, you'll have to create two new automacros for each field along the way. So, if you change the lockmap, there'll be a new route. You'd have to redo the whole thing for the new route.

It can't be done with useSelf_skill.

You can abstract the macro a little bit. Something like:

control/config.txt

Code: Select all

# Add this line in this file:
lastMap 
control/macros.txt

Code: Select all

automacro cloakRoute {
	mapchange *
	call {
		if ($.map != @config(lockMap) && $.map != @config(saveMap)) {
			do ss 135
		}
	}
}

automacro leaveCloak {
	console /Portal Exists: (.+) -> (.+) \((\d+),(\d+)\)/
	status EFST_CLOAKING
	call {
		if ($.lastMatch2 != @config(lastMap)) {
			do config lastMap $.map
			do ss 135
		}
	}
}
It uses the cloak skill everytime Openkore changes map (as long as it isn't to the lockmap or savemap). Also, when he spots a portal, and he's with the cloaking effect and the portal won't take him to the last map, he will leave the cloaking status.

I didn't test it, but the idea isn't hard to grasp. The only problem there is if the bot spots a portal along the way, but it's not the portal he'll go through. If that portal takes him to a map that doesn't belong to his route (and it isn't the last map) he'll leave the cloaking status along the way.

The most efficient way to do this is probably through the source code itself (or a plugin).
I'm watching my TV or is it watching me?

niggy852
Noob
Noob
Posts: 1
Joined: 21 Mar 2015, 23:14
Noob?: Yes

Re: cloak for safety

#7 Post by niggy852 »

Would someone care to explain what this means?

" console /Portal Exists: (.+) -> (.+) \((\d+),(\d+)\)/ "

I tried looking up regex but I don't understand the syntax too well and I was hoping to see if anyone could just explain it to me. I am trying to get this auto macro working for myself as well.

vitriol
Plain Yogurt
Plain Yogurt
Posts: 61
Joined: 19 Apr 2011, 23:26
Noob?: No

Re: cloak for safety

#8 Post by vitriol »

(.+) -> one or more characters for the portal source
(.+) -> "" portal destination
\( -> a literal (escaped) '(' instead of being used as a regex character
(\d+) -> one or more digits for the x location
(\d+) -> one or mroe digits for the y location
\) -> escaped ')'

User avatar
SkylorD
Moderators
Moderators
Posts: 1166
Joined: 16 Dec 2011, 02:53
Noob?: No
Location: Brazil
Contact:

Re: cloak for safety

#9 Post by SkylorD »

I tried looking up regex but I don't understand the syntax too well and I was hoping to see if anyone could just explain it to me. I am trying to get this auto macro working for myself as well.
I'll help ya : Click here for more info
Learn rules

Post Reply