Multiline Regexp Trigger

Posted by Zalethon on Sun 22 Apr 2007 07:22 AM — 4 posts, 18,106 views.

USA #0
I created a regexp trigger, and had it run vbscript. But it seems to only match once another line is on the screen in addition to the two lines it should match to.. Is there any way around this, or is there something I've done wrong that I can fix..?
Australia Forum Administrator #1
It would help greatly if you posted the trigger, and the lines from the MUD that you were hoping would match.
USA #2
The trigger:
^(\w+):(\d+)\/(\d+) \((\w+)\) \$(\d+) \(QP(\d+)\/XP(\d+)\/RP(\d+)\%\)\s?(\d+) \(T:(\w*)\) HP(\d+)\/(\d+) \(VH(\d+)\/(\d+) VF(\d+)\/(\d+) VA(\d+)\/(\d+)\) (\d+) >$

It matches to my prompt:
Field:12/791 (NESW) $104575 (QP99999/XP0/RP0%)
0 (T:) HP1000/1000 (VH0/0 VF0/0 VA0/0) 1319 >

And runs this code:

sub prompt (sName, sLine, aWildcard)
	dim x
	dim y
	dim z
	x = 1
	while x < 20
		y = gettriggerwildcard("prompt", x)
		select case x
			case 1
				z = "TerrainType"
			case 2
				z = "CoordX"
			case 3
				z = "CoordY"
			case 4
				z = "Exits"
			case 5
				z = "Cash"
			case 6
				z = "QuestPoints"
			case 7
				z = "Experience"
			case 8
				z = "GainPercentage"
			case 9
				z = "CombatTimer"
			case 10
				z = "Target"
			case 11
				z = "Health"
			case 12
				z = "MaxHealth"
			case 13
				z = "VHealth"
			case 14
				z = "VMaxHealth"
			case 15
				z = "VFuel"
			case 16
				z = "VMaxFuel"
			case 17
				z = "VAmmo"
			case 18
				z = "VMaxAmmo"
			case 19
				z = "DeathTimer"
		end select
		world.setvariable z, y
		x = x + 1
	Wend
End Sub
Australia Forum Administrator #3
Please read http://mushclient.com/faq, item 11.