Help - Search - Members - Calendar
Full Version: House Find W/Decal Companion!
AC Tools Everything Macro > AC Tool Macros > Asheron's Call Macros
PrismaticShimmer
I made this last night for a friend but i want to release it even though its only good for like 9 days. It is a macro that will run house available ever set number of minutes and search for villas open, if it finds one, it plays the Asterisk sound until you come to the pc and click stop.


Now, onto the Deca part, I made a little IG gui for it that lets you start/stop it with the push of a button, and you can easily set the delay to search from IG also.


user posted image
To start the bot click Start, then, enter your desired delay time between searces and click set. Then, finally, click Go. (Has to go in that order or the macro wont work right).

Attached is the macro which must be open in actool but not started.

The following link is to download the plugin DLL which needs to be added through decal since i didnt make it into an installer since its not going to live long with the upcoming patch..
HouseFindCompanion.dll
PrismaticShimmer
The people who have downloaded - How is it working?
thep33t
works great, plus i added it in for cottages too tongue.gif
that works good as well tongue.gif
thep33t
err, now after the second search, it says cottage found, even though one isnt available.

Procedure ScanForOpenHouse
SetActiveWindow Asheron's Call
FindTextClear MESSAGE
SayPaste /House Available
Delay 1 Sec
FindNextText MESSAGE, Villas: 0 available
If {PluginResult} <> TEXT NOT FOUND
Call Log DEBUG: Result for Villa was: {PluginResult}
Call Log No Villas Found on Search
//SendText 4, DEBUG - NO VILLAS FOUND ON SEARCH
Else
Call Log VILLA FOUND ON SEARCH @ {NOW}
SendText 9, ~* VILLA FOUND VILLA FOUND *~
Loop 999
Bell Asterisk
Delay 100
End
End
delay 2 sec
FindTextClear MESSAGE
SayPaste /House Available
Delay 1 Sec
FindNextText MESSAGE, Cottages: 0 available
If {PluginResult} <> TEXT NOT FOUND
Call Log DEBUG: Result for Cottage was: {PluginResult}
Call Log No Cottages Found on Search
//SendText 4, DEBUG - NO VILLAS FOUND ON SEARCH
Else
Call Log Cottage FOUND ON SEARCH @ {NOW}
SendText 9, ~* COTAGE FOUND COTTAGE FOUND *~
Loop 999
Bell Asterisk
Delay 100
End
End
End
Ipa
There is flawed logic in the original. Failure to code defensively for a network game like AC.

The code searches for the arrival of text "Villas: 0 available".
The code assumes 2 possible outcomes.
Assumption is the mother of all f'ups.

There are 3 possible outcomes.

The 3rd outcome yields a false-positive result when this code encounters it.



PrismaticShimmer
Burn em at the stake! sad.gif
PrismaticShimmer
Well to make a temp fix under the Saypaste /house available line, change that 1 second delay to like 10 sec.
thep33t
tried, that, didnt work, what are the 3 options for return, I can think of only 2...
Ipa

1. Text arrives, contains text that is being searched for.
2. Text arrives, doesn't contain text that is being searched for.

3. Server does not respond to "/House Available" within 1000 milliseconds, code falsely enters the same branch of logic as #2, and you ring alarm bells. Not because there aren't zero available, but because the server and/or internet is slow.

Best way to code this is enter a waiting loop, waiting for the last line of the Response. Last line is for "Apartments".
Once you can find the text "Apartments:", you know server has responded. Then you can go about locating the housing type you were looking for.
thep33t
SayPaste /House Available
delay 5 sec
FindNextText MESSAGE, Apartments:
if {PluginResult} <> TEXT NOT FOUND
delay 15 sec
end

FindNextText MESSAGE, Villas: 0 available
If {PluginResult} <> TEXT NOT FOUND
Call Log DEBUG: Result for Villa was: {PluginResult}
Else
Call Log VILLA FOUND ON SEARCH @ {NOW}
SendText 9, ~* VILLA FOUND VILLA FOUND *~
Loop 999
Bell Asterisk
Delay 100
End
End
End

would this work, i tried it with a loop, but for some reason whatever i tried gave me either an infinate loop, or i couldnt impliment correctly.
thep33t
hmm, that shoulkd work if the server send the info within 15 seconds, but it still doesnt, it always thinks the server hasnt sent the info yet...
DaMOB
SayPaste /House Available
delay 5 sec
FindNextText MESSAGE, Apartments:
if {PluginResult} <> TEXT NOT FOUND
delay 15 sec
end

What is that for? When/if it DOES find Apartments: it waits for 15secs? What is the purpose of that LONG wait?

edit: I see what you THINK its for but there is a flow of logic missing in there someplace.

This works.

CODE
Constants
 temp = 1
End
FindText MESSAGE,
While 1 = 1
 compute temp = {LoopNo} MOD 15
 If $temp = 1 or {LoopNo} = 1
   SayPaste /House Available
 End
 FindNextText MESSAGE, Apartments:
 If {PluginResult} <> TEXT NOT FOUND
   Sendtext 13, Found Apartments:
   Call lookforvillas
 End
 Delay 1 sec
End

Procedure lookforvillas
 FindText MESSAGE, Villas: 0 available
 If {PluginResult} <> TEXT NOT FOUND
   Sendtext 6, No Villas Found.
 Else
   SendText 1, Villa Found!!!! @ {NOW}
 End
 FindTextClear MESSAGE
 FindText MESSAGE,
End


Now realize this is not the best way to achieve this any longer since we know you have Decal because of the plugin portion.
PrismaticShimmer
k, im pretty sure I fixed its problem on fireing on false positives.. :|
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.