Jump to content
Shikazu

[Script CMD]autonext

Recommended Posts

So here is the plugin which has been requested here.

 

Thank you for requesting it, i was just thinking about stuff i can implement :P

 

The problem with this is, that the "next" buttons are still in the bottom of the window of that npc and they are not going to disappear, because the next is made by the server and not by the user. Just like XKore from openkore ^^

 

Anyways, here is the script for anyone who wants to use it.

 

#include <stdio.h>#include <string.h>#include "../common/HPMi.h"#include "../map/script.h"#include "../map/pc.h"HPExport struct hplugin_info pinfo = {	"autonext",		// Plugin name	SERVER_TYPE_MAP,// Which server types this plugin works with?	"1.0",			// Plugin version	HPM_VERSION,	// HPM Version (don't change, macro is automatically updated)};BUILDIN(autonext) {	TBL_PC* sd;	int timeout;		sd = script->rid2sd(st);	if( sd == NULL )		return true;#ifdef SECURE_NPCTIMEOUT	sd->npc_idle_type = NPCT_WAIT;#endif	timeout=script_getnum(st,2);	if(st->sleep.tick == 0)	{		st->state = RERUNLINE;		st->sleep.tick = timeout;	}	else	{// sleep time is over		st->state = RUN;		st->sleep.tick = 0;	}	clif->scriptnext(sd, st->oid);	return true;}/* Server Startup */HPExport void plugin_init (void) {	clif = GET_SYMBOL("clif");	script = GET_SYMBOL("script");	if( HPMi->addScript != NULL ) 	{		HPMi->addScript("autonext","i",BUILDIN_A(autonext));	}}

 

The Script command is used like this:

 

autonext 1000;

This means, the script is waiting for 1000 milliseconds and then it's using next!

If the user is pressing "next" on it's own, it is just ignored! Don't forget that!

 

If you encounter any bugs, just ping me!

 

~Shikazu

Edited by Shikazu

Share this post


Link to post
Share on other sites

For now it's causing a debug notice in the map-server console window, but that is fixed in the next commit.

 

If he clicks it, before it runs out, just nothing happens because the timeout is made with the script sleep causing the script sleeping so i cant change anything while the sleep is going on.

 

If you really need the next button to work, i have to rewrite some of that stuff also. so what do you need?

Share this post


Link to post
Share on other sites

So basically it will act like 'next' button when the timer ran out, but it doesn't interfere if the user presses it before it ran out.

Because if it's like that, the script will be paused for x seconds, waiting for the timer to end :)

Share this post


Link to post
Share on other sites

Yeah nana, it's just autonext :P  the timer runs and cant be interrupted by the user :D

 

So you need to go to /src/plugins/ and place the source above as "autonext.c".

 

Then you are creating the plugin project like here: http://herc.ws/wiki/Building_HPM_Plugin_for_MSVC

or you are just using the sample plugin project and replace the source with the one on page 1.

 

after that you can easily compile it.

 

Then you have to add "autonext" if the name of the .c file was autonext.c to your plugins.conf in your conf-folder and everything should be up and running.

 

I use gcc cause i'm compiling on a test server on my root :D

 

Additionally i have to say, that you should have the newest git version, because it's some bugfixing there =)

Edited by Shikazu

Share this post


Link to post
Share on other sites

This source is pretty old and only for windows, so i can't even compile it :D

 

It wouldn't even run on newer windows systems, because it is using raw sockets, which have been fucked up by microsoft since xp service pack 2.

 

 

Edit://

If i have some time left in the next week or so i'll check how to make a win/unix version out of it.

 

~Shikazu

Edited by Shikazu

Share this post


Link to post
Share on other sites

Heh, no problem. Since it's like i'm the first one trying to use it, there are a lot of untested things, so i am reporting everything to him, so he can fix it.

Share this post


Link to post
Share on other sites

  1. next button keep stacking up.
  2. script still running even the character no longer attach to the NPC ( ex: @warp during the npc conversation )
  3. message isnt cleared after the "autonext" which make like new page of message.

Preview :

 

s3zSFh7.gif

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.