Change Medals

User avatar
0x00
VIP
Posts: 105
Joined: Tue Jan 10, 2017 11:40 pm
Has thanked: 10 times
Been thanked: 23 times

Change Medals

Post by 0x00 » Thu Feb 02, 2017 3:21 am

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

Online
User avatar
nucular
Site Admin
Posts: 260
Joined: Sat Jan 07, 2017 9:08 pm
Has thanked: 27 times
Been thanked: 388 times

Re: Change Medals

Post by nucular » Sun Feb 05, 2017 5:21 pm

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.

Online
User avatar
nucular
Site Admin
Posts: 260
Joined: Sat Jan 07, 2017 9:08 pm
Has thanked: 27 times
Been thanked: 388 times

Re: Change Medals

Post by nucular » 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

User avatar
FarAwaY
Posts: 48
Joined: Sun Jan 29, 2017 9:31 pm
Has thanked: 22 times
Been thanked: 13 times

Re: Change Medals

Post by FarAwaY » Sat Feb 11, 2017 4:30 am

Is it possible to make the script faster without any crashes?
Image

agonic
VIP
Posts: 159
Joined: Tue Jan 10, 2017 6:39 pm
Has thanked: 34 times
Been thanked: 112 times

Re: Change Medals

Post by agonic » Sat Feb 11, 2017 2:05 pm

so, crash when ? how ?

User avatar
FarAwaY
Posts: 48
Joined: Sun Jan 29, 2017 9:31 pm
Has thanked: 22 times
Been thanked: 13 times

Re: Change Medals

Post by FarAwaY » 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 ^^
Image

Hakairo
Posts: 2
Joined: Fri Feb 10, 2017 10:54 am

Re: Change Medals

Post by Hakairo » 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

Online
User avatar
nucular
Site Admin
Posts: 260
Joined: Sat Jan 07, 2017 9:08 pm
Has thanked: 27 times
Been thanked: 388 times

Re: Change Medals

Post by nucular » Mon Feb 13, 2017 8:48 pm

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.

User avatar
0x00
VIP
Posts: 105
Joined: Tue Jan 10, 2017 11:40 pm
Has thanked: 10 times
Been thanked: 23 times

Re: Change Medals

Post by 0x00 » Wed Feb 15, 2017 1:47 am

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!

Max
Posts: 5
Joined: Wed Mar 15, 2017 9:13 pm
Has thanked: 5 times
Been thanked: 1 time

Re: Change Medals

Post by Max » Wed Mar 22, 2017 6:55 pm

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 .

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest