Ah I see what you mean. And this fixed the counter problem.
Code: Select all
#event create "#*#I'll give you #1# platinum#*#for the #2#.'"
#event create "#*#I'll give you #1# platinum#*#per #2#"
Sub main
/declare File string outer
/declare Counter [color=cyan]int[/color] outer
/varset File items.ini
:Loop
/doevents
/goto :Loop
/endmacro
Sub Event_create(Line, Plats, ItemName)
[color=cyan]/varset Counter ${Ini[${File},counter,c1]}[/color]
/ini ${File} names val${Counter} "${ItemName}"
/ini ${File} prices val${Counter} ${Plats}000
/varcalc Counter ${Counter}+1
/ini ${File} counter c1 ${Counter}
/varcalc Counter ${Counter}-1
/echo Created ${Counter} entry. ${ItemName} set for ${Plats} plat.!
/return
But now when I try the macro I am having a different problem. Say my ini looks like this before running the macro.
Code: Select all
[names]
val1=Words of crap
[values]
val1=1000 |set price for 1p
[counter]
c1=2
But then when I run the macro, and it grabs the item that I am selling, it creates 2 different values for the one item. The ini looks like this after trying to sell "Small Banded Sleeves"
Code: Select all
[names]
val1=Words of crap
val2=for the Small Banded Sleeves.'
val3=Small Banded Sleeves
[prices]
val1=1000 |set price for 1p
val2=1000
val3=1000
[counter]
c1=4
and I am getting 2 echos. The first echo is thinking the item name is "for the small banded sleeves.'" but the second echo gets it perfect. Why is the event being trigged twice when I try to sell an item and why is the first one getting the item name wrong??