xp show on Achaea

Post Reply
Rossimill
Posts: 3
Joined: Sun May 02, 2010 8:17 am

xp show on Achaea

Post by Rossimill »

I want to make a trigger to show my xp for a character on Achaea..similer to the one Vadi made in the Vadi System

Postulant ?, Novice of the Mind (male Satyr)test
You are level 52 (Brilliant) and 81% of the way to the next level.
Health: 2536/2536 Mana: 2068/2068test
Endurance: 11580/11580 Willpower: 9240/9240
Strength: 13 Dexterity: 13 Constitution: 13 Intelligence: 10
You are ranked ? in Achaea.
You are not known for acts of infamy.
You stand tall as a proud citizen of Shallam.
You are at the rank of 'Villager' (1) in your city.
You are a journeyman in the Blademaster class.
You are a Meditator (1) in the Sentaari.
You are a Vagabond in the Fellowship of Explorers.
You have a soul that is truly Seraphic.
You are mentored by ?
You are 19 years old, having been born on the 25th of Phaestian, 517 years
after the fall of the Seleucarian Empire.

First i made a substring trigger on ..Postulant ?, Novice of the Mind (male Satyr)
Then ...^You are level (\d+) (Brilliant) and (.*?) of the way to the next level\.$ - a perl regex
and ...^Health: (\d+)/(\d+) Mana: (\d+)/(\d+)$

with a echo("test")..you can see it upbove..
then i can make it echo next to my health and mana line...but i cannot seem to get a trigger from the second line..if it's a normal substring the test echo works..but not with the perl regex.i have tried this..
^You are level (\d+) (Brilliant) and (\d+)% of the way to the next level\.$ and
^You are level (\d+) (Brilliant) and (.*?) of the way to the next level\.$

Can anyone help?

Wyd
Posts: 54
Joined: Wed Mar 24, 2010 11:56 pm

Re: xp show on Achaea

Post by Wyd »

The line you're looking for would be

^You are level (\d+) (.*) and (\d+)% of the way to the next level\.$

However, another way of going about the whole thing is to use the CharVitals value in the ATCP table (atcp.CharVitals). Because this gets updated every time you gain experience (Achaea sends atcp.CharVitals regularly), you don't need to check SCORE to update the experience remaining.

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: xp show on Achaea

Post by tsuujin »

Yep. ATCP is really the way to go, for this.

Here's how I parse my vitals. It won't be usable by you, but it'll give you an idea of how it might be done:
Code: [show] | [select all] lua
function parseVitals(event,args)
	-- Parse the arguments from CharVitals, which are all in <stat>:<curr>/<max> format

	local convChart = {["A"]="adrenaline",["H"]="health",["M"]="mana",["E"]="endurance",["G"]="guile",["NL"]="xp"}

	for word in args:gmatch("[A-Z]+:%d+/%d+") do
		-- string is now broken down into individual parts. Rematch for specific parts.
		local stat = convChart[word:match("[A-Z]+")]
		local curr = word:match("(%d+)/")
		local max = word:match("/(%d+)")
		vitals:Set(stat,curr,max)
	end
end

Post Reply