Log in

View Full Version : Need help with chat box reader



ncore
02-23-2012, 08:58 PM
So here is an idea:

Ability to control your bots via clan channel. So you send out a message that says something like 'break' to have your bots take a break. I was wondering how I could go about getting this to work.

1. How could I get the bot to notice this and recognize a specific phrase with a specific color.
2. How exactly can I control where the mouse clicks to have it perform specific tasks once told to do so and to recognize responses.

Thanks. This would be my first script that I would make and I hope it works out well.

Brandon
02-23-2012, 09:18 PM
if (ExecRegExpr('break | Break', GetLastChatText)) then
Terminatescript; //or do whatever..

ncore
02-23-2012, 09:27 PM
Is there a tutorial on how I could set the mouse to do a specific action after the textbox is read?

Brandon
02-23-2012, 09:42 PM
A specific action? Such as what? That's a very vague and ambiguous question.

ncore
02-23-2012, 10:03 PM
does the mouse click based on an x,y chart? For example: I send a message like 'lobby' and the bot will go to the lobby and switch to a different world

Brandon
02-23-2012, 10:25 PM
Ok..


Function ExecuteCommands(Command: String): boolean;
var
MSG: String;
Bool: Boolean;
begin
GetLastChatText(MSG);
Bool:= ExecRegExpr(Command, MSG);

if Bool then
Case LowerCase(Command) Of
'break':
{Procedure To Do Breaks Here..};

'login':
LoginPlayer;

'exit lobby', 'exit to lobby', 'lobby':
ExitToLobby;

'leave lobby':
LeaveLobby;

'do whatever':
{Procedure to do whatever here..};
end;
end;

ncore
02-23-2012, 11:58 PM
ooo thanks! you are awesome! Now what if I wanted to trade a bot something and have it accept?