Jump to content
  • 0

progressbar stop when getting hitted?


PewN

Question


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

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;

Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  379
  • Reputation:   304
  • Joined:  11/10/11
  • Last Seen:  

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;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

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?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  379
  • Reputation:   304
  • Joined:  11/10/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  379
  • Reputation:   304
  • Joined:  11/10/11
  • Last Seen:  

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;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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
Link to comment
Share on other sites

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.

×
×
  • Create New...