My first conversion, I'm so proud. It's clumsy and it's ugly but it damn well works! Ty again for the assistance. If you see something in here that could be done without going around my ass to get there as I'm pretty sure I've done a few times I will gladly take suggestions.
Anyway, here it is:
Code: Select all
|Semper's conversion of Driftinsupra's Dumpster diving script
|Thanks to Driftinsupra for the original code, Lax and the devs for MQ2
|and making me learn this without handing it to me, and Chill, mpmq,
|ml2517, and banannaboy for their much needed help and suggestions.
Sub Main
/declare File outer
/declare Counter int outer
/declare l1 int outer
/declare Traderid outer
/declare Price outer
/declare Iniprice int outer
/varset File Bazprice.ini
/varset Counter 1
:mainloop
/echo Searching for ${Ini[${File},Names,val${Counter}]}
/bzsrch race any class any ${Ini[${File},Names,val${Counter}]}
| is request done?
:loop
/delay 10
/if (${Bazaar.Done}==FALSE) /goto :loop
/if (${Bazaar.Count}==0) {
/echo ${Ini[${File},Names,val${Counter}]} not found, continuing on...
/varcalc Counter ${Counter}+1
/goto :mainloop
}
}
/echo found ${Bazaar.Count} items
/varset l1 1
/varset Price ${Bazaar.Item[${l1}].Price}
/varset Traderid ${Bazaar.Item[${l1}].Trader}
/varset Iniprice ${Ini[${File},Prices,val${Counter}]}
/if (${Bazaar.Count}>1) {
/for l1 1 to ${Math.Calc[${Bazaar.Count}1]}
/echo ${l1} Price ${Bazaar.Item[${l1}].Price}
/if (${Price}>=${Iniprice}) {
/varset Price ${Bazaar.Item[${l1}].Price}
/varset Traderid ${Bazaar.Item[${l1}].Trader}
/docommand ${If[${Bazaar.Count}==${l1},/goto :finalcheck,/next l1]}
}
/if (${Price}<=${Iniprice}) {
/goto :finalcheck
}
}
:finalcheck
/if (${Price}>=${Iniprice}) {
/varcalc Counter ${Counter}+1
/echo Prices too high
/goto :mainloop
}
/echo Targeting ${Spawn[${Traderid}]}
/target ${Spawn[${Traderid}]}
/delay 20
/face
}
/endmacro
--Semper
Now I can finally sleep
--Edited credits as requested.
