Jump to content
  • 0

progressbar stop when getting hitted?


Question

Posted

how can i set like that?

i will set a progressbar and inputing a code when the player got hit the progressbar will stop and close the npc

progressbar start during inputing the code

progressbar "green",5;
input .@rcode;

7 answers to this question

Recommended Posts

Posted

Input and progressbar pause the script, so you have to run a new instance of the script in parallel.

Something like:

doevent strnpcinfo(3)+"::OnStartProgressBar";
input .@rcode;

[...]

OnStartProgressBar:
progressbar "green",5;

Posted

Input and progressbar pause the script, so you have to run a new instance of the script in parallel.

Something like:

doevent strnpcinfo(3)+"::OnStartProgressBar";
input .@rcode;

[...]

OnStartProgressBar:
progressbar "green",5;

how can i set if i getting hitted the npc will close?

Posted

Funny...

doevent strnpcinfo(3)+"::OnStartProgressBar";
doevent strnpcinfo(3)+"::OnCheckHit";
input .@rcode;

[...]

OnStartProgressBar:
progressbar "green", 5;
end;

OnCheckHit:
for ( set .@last_life, HP; .@i<5; set .@i, .@i+1 ) {
	if ( @last_life < HP )
		close;
	set .@last_life, HP;
	sleep2 1000;
}

Try it, but: I'm not sure if it will work to close the script like this (it should since it's the same npcid...), and there is noway to remove a npc dialog/menu/input without the need of the client (or @refresh).

  • Upvote 1
Posted

Funny...

doevent strnpcinfo(3)+"::OnStartProgressBar";
doevent strnpcinfo(3)+"::OnCheckHit";
input .@rcode;

[...]

OnStartProgressBar:
progressbar "green", 5;
end;

OnCheckHit:
for ( set .@last_life, HP; .@i<5; set .@i, .@i+1 ) {
	if ( @last_life < HP )
		close;
	set .@last_life, HP;
	sleep2 1000;
}

Try it, but: I'm not sure if it will work to close the script like this (it should since it's the same npcid...), and there is noway to remove a npc dialog/menu/input without the need of the client (or @refresh).

ok sir i will try this thx for this :D

Posted

nope this is never going to work

prontera,155,179,5    script    kjdhfkjshf    100,{
   doevent strnpcinfo(0)+"::Onstart";
   input .@name$;
   dispbottom "test";
   close;
Onstart:
   progressbar "", 3;
   end;
}

this one runs input 1st ... after input finish only runs progressbar

prontera,155,179,5    script    kjdhfkjshf    100,{
   doevent strnpcinfo(0)+"::Onstart";
   progressbar "", 3;
   dispbottom "test";
   close;
Onstart:
   input .@name$;
   end;
}

this one runs progressbar 1st, after 3 seconds finished then input only pops up

input, menu, close2, progressbar.... these sort of script commands can only run 1 at a time

and I have never been able to make them run at the same time

not sure if source modification able to bypass this limitation ... but I don't find this useful

Posted

And what about using sleep2 ?

prontera,155,179,5	script	kjdhfkjshf	100,{
doevent strnpcinfo(0)+"::Onstart";
sleep2 1; // execute doevent first

input .@name$;
dispbottom "test";
close;
Onstart:
progressbar "", 3;
end;
}

Posted

And what about using sleep2 ?

prontera,155,179,5	script	kjdhfkjshf	100,{
doevent strnpcinfo(0)+"::Onstart";
sleep2 1; // execute doevent first

input .@name$;
dispbottom "test";
close;
Onstart:
progressbar "", 3;
end;
}

input pop up 1st, then display "test", then progressbar comes in

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...