|
ekhart Novice
Joined: 28 Aug 2008 Posts: 31
|
Posted: Fri Mar 17, 2023 5:07 pm
Capturing Multiple Lines from sequence to input to database |
I know this should be easier than I am making it, but the break I took is making my brain fog :)
Below is the input received from the mud... obviously there may be fewer or more lines where 'Blunt' is and they could be different things like sharp, fire etc. I am trying to get it to capture all of these, probably best in to a database variable, to then enter in to my Cmud database for weapons.
The paste doesnt look even but all of the lines align on the game. The attack column starts with 2 spaces in front, Hitting starts on %pos 23 and Damage on %pos 48.
Code: |
You carefully inspect the Eiku.
Attack Hitting Damage
------------------ --------------------- ---------------------
Blunt: okay okay
Blunt: fair fair
Blunt: very poor pretty poor
Blunt: very poor very poor
------------------ --------------------- ---------------------
Overall: poor fair
--------------------------------------------------------------------
Durability: poor
It is a two handed weapon.
It uses the fighting.offensive.melee.blunt skill.
It saves at level 150.
|
Any help much appreciated! |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Fri Mar 24, 2023 2:09 am |
How much information are you wanting to keep?
You would need to flesh out these three variables more, so it fires when it is supposed to:
Code: |
weaponTypes=blunt|sharp|fire
hitType=okay|fair|very poor
damagaetype=okay|fair|pretty poor|very poor
#TR {You Carefully inspect the (*).} {
$weapon=%1
this=%db(@weaponsList, $weapon)
}
#COND {({@weaponType}): %s ({@hitType}) %s ({@damagetype})} {
$wt=%1
$ht=%2
$dt=%3
$that=%db(@this, $wt)
$other=%db($that, $ht)
#ADDITEM $other $dt
#ADDKEY $that $ht $other
#ADDKEY this $wt $that
#STATE 1
} {within|param=4}
#COND {It is a (*) weapon.} {#ADDKEY this Type %1}}
#COND {It uses the (%x) skill.} {#ADDKEY this Skill %1}
#COND {It saves at level (%d).} {
#ADDKEY this Saves %1
#ADDKEY weaponsList %t1 @this
}
|
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|
|
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 vote in polls in this forum
|
|