Code: Select all
/selectitem LETTUCE merchant
/delay 1s
/varset COST_OF_ITEM $merchant(LETTUCE,cost) lil` help
-M
Moderator: MacroQuest Developers
Code: Select all
/selectitem LETTUCE merchant
/delay 1s
/varset COST_OF_ITEM $merchant(LETTUCE,cost) 
Code: Select all
#Event VendorPrice " tells you, 'That'll be "
.
.
.
Sub Event_VendorPrice(merchtext)
If "$arg(2, @merchtext)"=="platinum" PlatPieces = $arg(1, @merchtext)
If "$arg(2, @merchtext)"=="gold" GoldPieces = $arg(1, @merchtext)
If "$arg(2, @merchtext)"=="silver" SilverPieces = $arg(1, @merchtext)
If "$arg(2, @merchtext)"=="copper" CopperPieces = $arg(1, @merchtext)
/returnCode: Select all
#Event VendorPrice " tells you, 'That'll be "
/declare PlatPieces Global
/declare GoldPieces Global
....etc..
/declare merchtext Global
/varset PlatPieces 0
/varset GoldPieces 0
....etc...
.
.
/selectitem "Tasty Lettuce" merchant
/delay 1s
/if "$selecteditem()"=="Tasty Lettuce" {
/echo Vendor Has It!
[color=yellow]/doevents[/color]
/echo after /doevents we now have PP=@PlatPieces, GP=@GoldPieces, SP=@SilverPieces and CP=@CopperPieces
/varset Price @PlatPieces [color=yellow] | I suspect the trouble is here with the /varset or /varcat[/color]
/varcat Price @GoldPieces
/varcat Price @SilverPieces
/varcat Price @CopperPieces
/echo @Price > 2102 ? [color=yellow]| 2102 = 2pp, 1gp, 0sp, 2cp[/color]
/if @Price>2102 {
.
.
.
Sub Event_VendorPrice(merchtext)
[color=yellow]/if "@merchtext"~~"Tasty Lettuce" {[/color]
/If $arg(8,"@merchtext")=="platinum" { [color=yellow] if 8th word in Merchtext is [b]platinum[/b] then...[/color]
/varset PlatPieces $arg(7,"@merchtext")
/If $arg(10,"@merchtext")=="gold" {
/varset GoldPieces $arg(9,"@merchext")
} else {
/varset GoldPieces 0
}
/If $arg(12,"@merchtext")=="silver" {
/varset SilverPieces $arg(11,"@merchtext")
} else {
/varset SilverPieces 0
}
/If $arg(14,"@merchtext")=="copper" {
/varset CopperPieces $arg(13,"@merchtext")
} else {
/varset CopperPieces 0
}
/goto :end
}

Code: Select all
Sub Event_VendorPrice(merchtext)
/if "@merchtext"~~"Tasty Lettuce" {
/echo $arg(8,"@merchtext")
/echo $arg(10,"@merchtext")
/echo $arg(12,"@merchtext")
/If $arg(8,"@merchtext")=="platinum" {
/varset PlatPieces $arg(7,"@merchtext")
[color=yellow]/echo here I'm /varset PlatPieces $arg(7,"@merchtext")[/color]
/If $arg(10,"@merchtext")=="gold" {
/varset GoldPieces $arg(9,"@merchext")
[color=yellow]/echo here I'm /varset GoldPieces $arg(9,"@merchtext")[/color]
} else {
/varset GoldPieces 0
}
/If $arg(12,"@merchtext")=="silver" {
/varset SilverPieces $arg(11,"@merchtext")
[color=yellow]/echo here I'm /varset SilverPieces $arg(11,"@merchtext")[/color]
} else {
/varset SilverPieces 0
}
/If $arg(14,"@merchtext")=="copper" {
/varset CopperPieces $arg(13,"@merchtext")
[color=yellow]/echo here I'm /varset CopperPieces $arg(13,"@merchtext")[/color]
} else {
/varset CopperPieces 0
}
/goto :end
}
/If $arg(8,"@merchtext")=="gold" {
/varset PlatPieces 0
/varset GoldPieces "$arg(7,"@merchtext")"
[color=yellow]/echo GoldPieces = @GoldPieces[/color]
/If "$arg(10,"@merchtext")"=="silver" {
/varset SilverPieces "$arg(9,"@merchtext")"
[color=yellow] /echo SilverPieces = @SilverPieces[/color]
} else {
/varset SilverPieces 0
[color=yellow] /echo SilverPieces = @SilverPieces[/color]
}
/If "$arg(12,"@merchtext")"=="copper" {
/varset CopperPieces "$arg(1,"@merchtext")"
[color=yellow] /echo CopperPieces = @CopperPieces[/color]
} else {
/varset CopperPieces 0
/echo CopperPieces = @CopperPieces
}
}
/If "$arg(8,"@merchtext")"=="silver" {
/varset PlatPieces 0
/varset GoldPieces 0
/varset SilverPieces $arg(7, "@merchtext")
/If "$arg(10,"@merchtext")"=="copper" {
/varset CopperPieces "$arg(9, "@merchtext")"
} else {
/varset CopperPieces 0
}
}
/If "$arg(8,"@merchtext")"=="copper" {
/varset PlatPieces 0
/varset GoldPieces 0
/varset SilverPieces 0
/varset CopperPieces "$arg(7, "@merchtext")"
}
}
:end
/return
Code: Select all
/If $arg(8,"@merchtext")=="platinum" {
/varset PlatPieces $arg(7,"@merchtext")
/echo here I'm /varset PlatPieces $arg(7,"@merchtext")
/If $arg(10,"@merchtext")=="gold" {
/varset GoldPieces $arg(9,"[color=red][size=200]@merchext")[/size][/color]
/echo here I'm /varset GoldPieces $arg(9,"@merchtext")
} else {
/varset GoldPieces 0
Code: Select all
/echo after /doevents we now have PP=@PlatPieces, GP=@GoldPieces, SP=@SilverPieces and CP=@CopperPieces
/varset Price @PlatPieces
/varcat Price @GoldPieces
/varcat Price @SilverPieces
/varcat Price @CopperPiecesCode: Select all
/if @Price>25000
/echo "Tasty Lettuce" cost @Price! Tha's too much!Code: Select all
/if $int(@Price)>$int($ini(dive_stuff.ini,BUDGET,@Counter))Code: Select all
/if [color=red][size=200]n[/size][/color] $int(@Price)>$int($ini(dive_stuff.ini,BUDGET,@Counter))