Page 1 of 2

Change Medals

Posted: Thu Feb 02, 2017 3:21 am
by 0x00
ChangeMedal.lua

Code: Select all

function OnLoad()
PlayerInput:Console("/select Moterinerk");
-- PlayerInput:Console("/select Mezirinerk");
end

function OnRun()
	if not DialogList:GetDialog( "dlg_dialog" ):IsVisible() then
		PlayerInput:Console( "/Attack" );
		Timer = Time() + 400;
		return false;
	end
		if Timer ~= nil and Timer >= Time() then
					return false;
				elseif Step == 0 or Step == nil then
						DialogList:GetDialog( "dlg_dialog/html_view/1" ):Click();
						Step = 1;
						Timer = Time() + 400;
					return false; 
			else
	
			if Step == 1 then
					DialogList:GetDialog( "dlg_dialog/accept_simple" ):Click();
					Step = 2;
					Timer = Time() + 400;
				return false;
			elseif Step == 2 then
					DialogList:GetDialog( "dlg_dialog/html_view/1" ):Click();
					Step = 3;
					Timer = Time() + 400;
				return false;	 
			elseif Step == 3 then
					DialogList:GetDialog( "dlg_dialog/html_view/1" ):Click();
					Step = 4;
					Timer = Time() + 400;
				return false;	
			elseif Step == 4 then
					DialogList:GetDialog( "dlg_dialog/ok" ):Click();
					Step = 0;
					Timer = Time() + 400;
				return false; 
			end
		end
end

Re: Change Medals

Posted: Sun Feb 05, 2017 5:21 pm
by nucular
I fixed it and updated 0x00 Post. Have fun ;-)

You have to change in the beginning of the lua script the name of the npc.

Re: Change Medals

Posted: Wed Feb 08, 2017 9:41 pm
by nucular
Asmodian Coin Fountain Script

Have fun

Code: Select all

function OnLoad()
PlayerInput:Console("/select Nosra Coin Fountain");
end

function OnRun()
	if not DialogList:GetDialog( "dlg_dialog" ):IsVisible() then
		PlayerInput:Console( "/Attack" );
		Timer = Time() + 400;
		return false;
	end
		if Timer ~= nil and Timer >= Time() then
					return false;
				elseif Step == 0 or Step == nil then
						DialogList:GetDialog( "dlg_dialog/html_view/1" ):Click();
						Step = 1;
						Timer = Time() + 400;
					return false; 
			else
	
			if Step == 1 then
					DialogList:GetDialog( "dlg_dialog/ok" ):Click();
					Step = 2;
					Timer = Time() + 400;
				return false;
			elseif Step == 2 then
					DialogList:GetDialog( "dlg_dialog/close" ):Click();
					Step = 0;
					Timer = Time() + 400;
				return false;	 
			end
		end
end

Re: Change Medals

Posted: Sat Feb 11, 2017 4:30 am
by FarAwaY
Is it possible to make the script faster without any crashes?

Re: Change Medals

Posted: Sat Feb 11, 2017 2:05 pm
by agonic
so, crash when ? how ?

Re: Change Medals

Posted: Sat Feb 11, 2017 9:35 pm
by FarAwaY
I only asked maybe i Change it to 1 and it will Crash idk so i just ask ^^

Re: Change Medals

Posted: Mon Feb 13, 2017 7:44 pm
by Hakairo
nucular wrote:
Wed Feb 08, 2017 9:41 pm
Asmodian Coin Fountain Script

Have fun

Code: Select all

function OnLoad()
PlayerInput:Console("/select Nosra Coin Fountain");
end

function OnRun()
	if not DialogList:GetDialog( "dlg_dialog" ):IsVisible() then
		PlayerInput:Console( "/Attack" );
		Timer = Time() + 400;
		return false;
	end
		if Timer ~= nil and Timer >= Time() then
					return false;
				elseif Step == 0 or Step == nil then
						DialogList:GetDialog( "dlg_dialog/html_view/1" ):Click();
						Step = 1;
						Timer = Time() + 400;
					return false; 
			else
	
			if Step == 1 then
					DialogList:GetDialog( "dlg_dialog/ok" ):Click();
					Step = 2;
					Timer = Time() + 400;
				return false;
			elseif Step == 2 then
					DialogList:GetDialog( "dlg_dialog/close" ):Click();
					Step = 0;
					Timer = Time() + 400;
				return false;	 
			end
		end
end
I often get "- [string "fountain.lua"]:14: attempt to index a nil value" which stops the script completely

Re: Change Medals

Posted: Mon Feb 13, 2017 8:48 pm
by nucular
Hakairo wrote:
Mon Feb 13, 2017 7:44 pm
nucular wrote:
Wed Feb 08, 2017 9:41 pm
Asmodian Coin Fountain Script

Have fun

Code: Select all

function OnLoad()
PlayerInput:Console("/select Nosra Coin Fountain");
end

function OnRun()
	if not DialogList:GetDialog( "dlg_dialog" ):IsVisible() then
		PlayerInput:Console( "/Attack" );
		Timer = Time() + 400;
		return false;
	end
		if Timer ~= nil and Timer >= Time() then
					return false;
				elseif Step == 0 or Step == nil then
						DialogList:GetDialog( "dlg_dialog/html_view/1" ):Click();
						Step = 1;
						Timer = Time() + 400;
					return false; 
			else
	
			if Step == 1 then
					DialogList:GetDialog( "dlg_dialog/ok" ):Click();
					Step = 2;
					Timer = Time() + 400;
				return false;
			elseif Step == 2 then
					DialogList:GetDialog( "dlg_dialog/close" ):Click();
					Step = 0;
					Timer = Time() + 400;
				return false;	 
			end
		end
end
I often get "- [string "fountain.lua"]:14: attempt to index a nil value" which stops the script completely
Increase the Timer Value from 400 to 600 and make sure you are not clicking in the game when the script runs.

Re: Change Medals

Posted: Wed Feb 15, 2017 1:47 am
by 0x00
FarAwaY wrote:
Sat Feb 11, 2017 9:35 pm
I only asked maybe i Change it to 1 and it will Crash idk so i just ask ^^
Can I really recommend something to EVERYONE? TEST first! Then report with problems, its so much easier!

Re: Change Medals

Posted: Wed Mar 22, 2017 6:55 pm
by Max
FarAwaY wrote:
Sat Feb 11, 2017 9:35 pm
I only asked maybe i Change it to 1 and it will Crash idk so i just ask ^^
That moment and you wish someone was using an Albert Einstein Avatar(picture) instead of Patrick's .