TomTuff
2010-10-23 05:01:12
So i'm making a script that i want to be pure reflection. How do i use reflection to interact with items that pop up while in a shop screen?
also, i just have to show off my genius in this function really quick :redface:
[brag]
also, i just have to show off my genius in this function really quick :redface:
[brag]
procedure SellFood;
var
ToSell, ToSellFives, ToSellOnes, DivBy, i, sold: integer;
SellString: string;
begin
GameTab(Tab_inv);
ToSell := 28 - R_InvCount;
SellString := IntToStr(ToSell);
case length(SellString) of
1: DivBy := 1;
2: DivBy := 10;
end;
for i := 0 to ((Floor(ToSell/DivBy)) - 1) do
begin
R_ClickItemID((SetFoodID + 1), false, 'Sell 10');
IncEx(Sold, 10);
Wait(RandomRange(100,300));
end;
ToSellFives := (Floor((ToSell - Sold)/5));
for i := 0 to (ToSellFives - 1) do
begin
R_ClickItemID((SetFoodID + 1), false, 'Sell 5');
incEx(Sold, 5);
Wait(RandomRange(100,300));
end;
ToSellOnes := (ToSell - Sold);
for i := 0 to (ToSellOnes - 1) do
begin
R_ClickItemID((SetFoodID + 1), false, 'Sell 1');
Inc(Sold);
Wait(RandomRange(100,300));
end;
end;
[/brag]