SRL Archive - OSR Help

Help with talking to NPC's (OSRS Lape)(Reflection & Aerolib)


funnyman9292

2015-03-31 19:16:40

Hey all, I'm trying to create a script that will get your player thru the runescape training preformed at beginning of game. My issue is that I can't get my player to click through the chat. Here's my code [PHP]
program RUNME;
{$DEFINE SMART}
{$DEFINE WALKER}

{$i AeroLib/AeroLib.Simba}
{$i Reflection/Reflection.simba}

var MyPlayer: TReflectLocalPlayer;
procedure DeclarePlayers;
begin
MyPlayer.Username := 'Deleted';
MyPlayer.Password := 'Deleted';
MyPlayer.Pin := '';
MyPlayer.Active := True;
MyPlayer.Login;
end;
procedure FindTheMan;
var AllNpcs: TReflectNpcArray;
OurNpc: TReflectNpc;
Point: Tpoint;
begin
AllNpcs.GetAll;//Loads all Npcs into 'AllNpcs'
AllNpcs.Get('RuneScape Guide');// loads all Npcs with name 'RuneScape Guide into 'AllNpcs'

if OurNpc.Find('RuneScape Guide') then //Loads the closest Npc with Name 'Runescape Guide' and returns true if found
begin
Point := OurNpc.GetMsPoint;
HumanMMouse(Point, 2, 2);
FastClick(MOUSE_LEFT);

TReflectionChat.NpcClickToContinue: Boolean; //This was a suggestion I found, doesn't work.
end;
end;
begin
initAL();
Reflect.Setup;
DeclarePlayers;
FindTheMan;
end. [/PHP]

Flight

2015-03-31 21:12:57

Luckily AeroLib has a function that should finish your conversation when chatting with an NPC, which you can find in the 'Chat' file (Includes>AeroLib>core>Chat.simba). Give this a whirl:

if OurNpc.Find('RuneScape Guide') then //Loads the closest Npc with Name 'Runescape Guide' and returns true if found
begin
Point := OurNpc.GetMsPoint;
HumanMMouse(Point, 2, 2);
FastClick(MOUSE_LEFT);
if waitFunc(@isPlayerWalking, 60, 2000) then // If we have to walk to the NPC then
while isPlayerWalking() do // Wait while walking
wait(50);
waitFunc(@areTalking, 60, 4000); // Wait until we start talking
if doConversation([]) then // Continue through the conversation
writeln('Finished our NPC conversation!');
end;
Also that function will continue the chat via the space bar rather than manual mouse-clicking, if that makes any difference to you. Also, I recommend using "
" tags rather than "[PHP]" tags.

funnyman9292

2015-03-31 23:13:13

This makes alot of sense! Thanks for the help Flight.

funnyman9292

2015-04-04 01:47:23

@Flight what if I need to pick one of three things to say to an NPC? (Img attached as example) I tried doConversation.(['Goodbye']) but It didn't work and frankly I don't know what a Tstringarray does.

Thanks[ATTACH=CONFIG]25498[/ATTACH]

Home

2015-04-04 08:00:51

From: funnyman9292
@Flight what if I need to pick one of three things to say to an NPC? (Img attached as example) I tried doConversation.(['Goodbye']) but It didn't work and frankly I don't know what a Tstringarray does.

Thanks[ATTACH=CONFIG]25498[/ATTACH]


TStringArray is Array of Strings. Ex. ['Goodbye', 'oodbye', 'bye'].

~Home