snowflake1963 1 Posted February 22, 2014 Hello All ^^ I have a script for @sleep that I used with rAthena and tried it here and failed I really like this command and would like to use it still. Here is my script: /**===================================* Sleep (@sleep)*-----------------------------------*/ACMD_FUNC(sleep){ if (agit_flag) // skill not useable in WOE [A17kaliva] { clif_displaymessage(fd, "Cannot use this command during WOE."); return -1; } if(!battle_config.prevent_logout || DIFF_TICK(gettick(), sd->canlog_tick) > 10) { if(sd->sc.opt1 != 0 && sd->sc.opt1 != OPT1_SLEEP){ clif_displaymessage(fd, msg_txt(sd,807)); return -1; } if(sd->sc.opt1 != OPT1_SLEEP){ sc_start(NULL,&sd->bl, SC_TRICKDEAD, 100, 1, 1000); sd->sc.opt1 = OPT1_SLEEP; //sc_start(NULL,&sd->bl, SC_COMA,100,1,skill_get_time2(185,1)); clif_displaymessage(fd, msg_txt(sd,805)); // sleeping } else { sd->sc.opt1 = 0; clif_emotion(&sd->bl,45); status_change_end(&sd->bl, SC_TRICKDEAD, -1); //sc_start(NULL,&sd->bl, SC_COMA,100,1,skill_get_time2(185,1)); clif_displaymessage(fd, msg_txt(sd,806)); // awake } clif_changeoption(&sd->bl); return 0; } clif_displaymessage(fd, msg_txt(sd,807)); return -1;} Can anyone PLEASE help me to make this work? Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted February 22, 2014 try again patch http://upaste.me/a84610750e12ec25a plugin http://upaste.me/6611107511ac763ee plugin is the way that you don't have to edit the source codeits kinda hard to install, but once get used to it, its quite convenient http://herc.ws/wiki/Building_HPM_Plugin_for_MSVC Quote Share this post Link to post Share on other sites
0 Hadeszeus 15 Posted February 22, 2014 Change ACMD_FUNC to ACMD. Quote Share this post Link to post Share on other sites
0 snowflake1963 1 Posted February 22, 2014 I did what you suggested and the compiler gave the following errors: atcommand.cc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(3646): warning C4013: 'intif_broadcast' undefiniert; Annahme: extern mit Rückgabetyp intc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8392): error C2065: 'agit_flag': nichtdeklarierter Bezeichnerc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8394): warning C4013: 'clif_displaymessage' undefiniert; Annahme: extern mit Rückgabetyp intc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8397): warning C4013: 'gettick' undefiniert; Annahme: extern mit Rückgabetyp intc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8399): warning C4002: Zu viele übergebene Parameter für das Makro 'msg_txt'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8399): warning C4047: 'Funktion': Anzahl der Dereferenzierungen bei 'int' und 'map_session_data *' unterschiedlichc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8399): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 1c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8403): warning C4002: Zu viele übergebene Parameter für das Makro 'sc_start'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8403): error C2440: 'Funktion': 'block_list *' kann nicht in 'sc_type' konvertiert werdenc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8403): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 2c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8406): warning C4002: Zu viele übergebene Parameter für das Makro 'msg_txt'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8406): warning C4047: 'Funktion': Anzahl der Dereferenzierungen bei 'int' und 'map_session_data *' unterschiedlichc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8406): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 1c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8409): warning C4013: 'clif_emotion' undefiniert; Annahme: extern mit Rückgabetyp intc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8412): warning C4002: Zu viele übergebene Parameter für das Makro 'msg_txt'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8412): warning C4047: 'Funktion': Anzahl der Dereferenzierungen bei 'int' und 'map_session_data *' unterschiedlichc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8412): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 1c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8415): warning C4013: 'clif_changeoption' undefiniert; Annahme: extern mit Rückgabetyp intc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8418): warning C4002: Zu viele übergebene Parameter für das Makro 'msg_txt'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8418): warning C4047: 'Funktion': Anzahl der Dereferenzierungen bei 'int' und 'map_session_data *' unterschiedlichc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8418): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 1 atcommand.cc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(3646): warning C4013: 'intif_broadcast' undefiniert; Annahme: extern mit Rückgabetyp intc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8392): error C2065: 'agit_flag': nichtdeklarierter Bezeichnerc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8394): warning C4013: 'clif_displaymessage' undefiniert; Annahme: extern mit Rückgabetyp intc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8397): warning C4013: 'gettick' undefiniert; Annahme: extern mit Rückgabetyp intc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8399): warning C4002: Zu viele übergebene Parameter für das Makro 'msg_txt'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8399): warning C4047: 'Funktion': Anzahl der Dereferenzierungen bei 'int' und 'map_session_data *' unterschiedlichc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8399): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 1c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8403): warning C4002: Zu viele übergebene Parameter für das Makro 'sc_start'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8403): error C2440: 'Funktion': 'block_list *' kann nicht in 'sc_type' konvertiert werdenc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8403): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 2c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8406): warning C4002: Zu viele übergebene Parameter für das Makro 'msg_txt'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8406): warning C4047: 'Funktion': Anzahl der Dereferenzierungen bei 'int' und 'map_session_data *' unterschiedlichc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8406): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 1c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8409): warning C4013: 'clif_emotion' undefiniert; Annahme: extern mit Rückgabetyp intc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8412): warning C4002: Zu viele übergebene Parameter für das Makro 'msg_txt'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8412): warning C4047: 'Funktion': Anzahl der Dereferenzierungen bei 'int' und 'map_session_data *' unterschiedlichc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8412): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 1c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8415): warning C4013: 'clif_changeoption' undefiniert; Annahme: extern mit Rückgabetyp intc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8418): warning C4002: Zu viele übergebene Parameter für das Makro 'msg_txt'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8418): warning C4047: 'Funktion': Anzahl der Dereferenzierungen bei 'int' und 'map_session_data *' unterschiedlichc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8418): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 1 Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted February 22, 2014 (edited) patch http://upaste.me/a84610750e12ec25a plugin http://upaste.me/6611107511ac763ee Edited February 22, 2014 by AnnieRuru Quote Share this post Link to post Share on other sites
0 snowflake1963 1 Posted February 22, 2014 Thank you for your help I put in the code and i still have 3 errors when recompiling: c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8403): warning C4002: Zu viele übergebene Parameter für das Makro 'sc_start'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8403): error C2440: 'Funktion': 'block_list *' kann nicht in 'sc_type' konvertiert werdenc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8403): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 2 This points to line 8403 which is: sc_start(NULL,&sd->bl, SC_TRICKDEAD, 100, 1, 1000); Can you please explain? mfg Snowflake Quote Share this post Link to post Share on other sites
0 snowflake1963 1 Posted February 22, 2014 patch http://upaste.me/a84610750e12ec25a plugin http://upaste.me/6611107511ac763ee I am a bit confused now Where shall I put what mfg Snowflake Quote Share this post Link to post Share on other sites
0 karazu 33 Posted February 22, 2014 (edited) Use the plugin, its good ..Isn't it same with afk? the sleep? Edited February 22, 2014 by karazu Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted February 22, 2014 @afk will kick the player offline, but the player will still be vulnerable clif->chsys_quit(sd); clif->authfail_fd(sd->fd, 15);.. this @sleep will just make the player invulnerable by using novice's trick dead skill, but doesn't kick the player offline quite good if you want to idle(go to toilet hahaha) inside a dungeon where aggressive monsters around Quote Share this post Link to post Share on other sites
0 snowflake1963 1 Posted February 22, 2014 Followed your hint and the guide. Sadly my compiler give a fatal error now: c:transfersnowhercules serversnow3 - hercules trunksrcpluginsat_sleep.c(10): fatal error C1083: Datei (Include) kann nicht geöffnet werden: "../common/HPMDataCheck.h": No such file or directory mfg Snowflake Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted February 22, 2014 how old is your hercules ? at least update to the latest one if you are using outdated hercules then use the patch Quote Share this post Link to post Share on other sites
0 snowflake1963 1 Posted February 22, 2014 My Hercules is 2 weeks old. I downloaded it with GIT. mfg Snowflake Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted February 22, 2014 http://herc.ws/board/topic/4283-introducing-hpm-datacheck/ should be more than that how about you just remove that line and see that works ? Quote Share this post Link to post Share on other sites
0 snowflake1963 1 Posted February 22, 2014 Followed your hint and used GIT update. Compile was fine. 0 errors. BUT now i have millions of errors pointing to the mob_db. I think the server forgot how to read mob_db2, cause all errors say non-existing mob with my custom mobid's. Really need HELP with that mfg Snowflake The Mob error is gone, it was a setting in mob.h. Sorry was extrem confused in that moment. Will test @sleep now mfg Snowflake Quote Share this post Link to post Share on other sites
0 snowflake1963 1 Posted February 22, 2014 Works fine, thank you very much Annie mfg Snowflake Quote Share this post Link to post Share on other sites
0 karazu 33 Posted February 22, 2014 @afk will kick the player offline, but the player will still be vulnerable clif->chsys_quit(sd); clif->authfail_fd(sd->fd, 15);.. this @sleep will just make the player invulnerable by using novice's trick dead skill, but doesn't kick the player offline quite good if you want to idle(go to toilet hahaha) inside a dungeon where aggressive monsters around I see, Thank you Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted February 24, 2014 (edited) I just found a bug on my plugin my test server has prevent_logout defaulted to 0 inside my import folder, makes me forget to change this change this line if ( !battle_config.prevent_logout || DIFF_TICK( timer->gettick(), sd->canlog_tick) > battle_config.prevent_logout ) {intoif ( !battle->bc->prevent_logout || DIFF_TICK( timer->gettick(), sd->canlog_tick) > battle->bc->prevent_logout ) {then add this below battle = GET_SYMBOL("battle");.. . the patch is unaffected .... just redownload the plugin will do, I've changed that Edited February 24, 2014 by AnnieRuru Quote Share this post Link to post Share on other sites
0 安赫尔 9 Posted February 24, 2014 What is the function of this? Quote Share this post Link to post Share on other sites
0 snowflake1963 1 Posted February 24, 2014 (edited) you type @sleep and then your character lays down ( looks like Novice Skill Trickdead ) and sleeps ( zZzZzZ ~ over your head ). Type @sleep again to wake up. While you sleep you can not be attacked. Usefull to go pee or poo in real life while your charcter is on a field or in a dungeon with agressive mobs. mfg Snowflake Edited February 24, 2014 by snowflake1963 1 AnnieRuru reacted to this Quote Share this post Link to post Share on other sites
0 snowflake1963 1 Posted March 6, 2014 The command worked great on our test server (windows) but when we went to put Hercules to our root (linux) we get the message: file at_sleep.so can not be found. How to get this file? Thank you in advance Quote Share this post Link to post Share on other sites
0 安赫尔 9 Posted March 6, 2014 see this http://herc.ws/wiki/Building_HPM_Plugin_for_gcc it‘s very easy in Linux to build a plugins Quote Share this post Link to post Share on other sites
0 snowflake1963 1 Posted March 11, 2014 (edited) Tried that but somehow my Linux gets stuck at compiling HPMHooking.c. I waited almost 2 hrs but nothing happend. Not even an error message. Mfg Snowflake Edited March 11, 2014 by snowflake1963 Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted March 11, 2014 HPMHooking.c I completely remove the one default in hercules and rebuilt it from clean also this particular plugin doesn't need to have HPMHooking anyways Quote Share this post Link to post Share on other sites
0 snowflake1963 1 Posted March 11, 2014 (edited) Its disabled in plugins.conf. So where to disable that ? Maybe here ? # Plugins that will be built through 'make plugins' or 'make all'PLUGINS = sample db2sql HPMHooking $(MYPLUGINS) like that ? # Plugins that will be built through 'make plugins' or 'make all'PLUGINS = $(MYPLUGINS) Mfg Snowflake Edited March 11, 2014 by snowflake1963 Quote Share this post Link to post Share on other sites
0 snowflake1963 1 Posted August 17, 2014 Hello Annie, its me again I updated my server around the 10th of August 2014 and got this error messages from my compiler 3> at_sleep.c3>c:transfersnowhercules serverhercules trunksrcpluginsat_sleep.c(30): warning C4013: 'DIFF_TICK' undefiniert; Annahme: extern mit Rückgabetyp int3>c:transfersnowhercules serverhercules trunksrcpluginsat_sleep.c(30): error C2065: 'timer': nichtdeklarierter Bezeichner3>c:transfersnowhercules serverhercules trunksrcpluginsat_sleep.c(30): error C2223: Der linke Teil von '->gettick' muss auf eine Struktur/Union zeigen3>c:transfersnowhercules serverhercules trunksrcpluginsat_sleep.c(57): error C2065: 'timer': nichtdeklarierter Bezeichner3>c:transfersnowhercules serverhercules trunksrcpluginsat_sleep.c(57): warning C4047: '=': Anzahl der Dereferenzierungen bei 'int' und 'void *' unterschiedlich Sorry for the german text, its just what my compiler gives me, cause my computer has a german windows. How can I fix this problem ? I am using the plugin you gave me. Thanks in advance Snowflake Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted August 18, 2014 Hello Annie, its me again I updated my server around the 10th of August 2014 and got this error messages from my compiler 3> at_sleep.c3>c:transfersnowhercules serverhercules trunksrcpluginsat_sleep.c(30): warning C4013: 'DIFF_TICK' undefiniert; Annahme: extern mit Rückgabetyp int3>c:transfersnowhercules serverhercules trunksrcpluginsat_sleep.c(30): error C2065: 'timer': nichtdeklarierter Bezeichner3>c:transfersnowhercules serverhercules trunksrcpluginsat_sleep.c(30): error C2223: Der linke Teil von '->gettick' muss auf eine Struktur/Union zeigen3>c:transfersnowhercules serverhercules trunksrcpluginsat_sleep.c(57): error C2065: 'timer': nichtdeklarierter Bezeichner3>c:transfersnowhercules serverhercules trunksrcpluginsat_sleep.c(57): warning C4047: '=': Anzahl der Dereferenzierungen bei 'int' und 'void *' unterschiedlich Sorry for the german text, its just what my compiler gives me, cause my computer has a german windows. How can I fix this problem ? I am using the plugin you gave me. Thanks in advance Snowflake try to add a line #include "../common/timer.h" on the header Quote Share this post Link to post Share on other sites
Hello All ^^
I have a script for @sleep that I used with rAthena and tried it here and failed
I really like this command and would like to use it still.
Here is my script:
/*
*===================================
* Sleep (@sleep)
*-----------------------------------
*/
ACMD_FUNC(sleep){
if (agit_flag) // skill not useable in WOE [A17kaliva]
{
clif_displaymessage(fd, "Cannot use this command during WOE.");
return -1;
}
if(!battle_config.prevent_logout || DIFF_TICK(gettick(), sd->canlog_tick) > 10) {
if(sd->sc.opt1 != 0 && sd->sc.opt1 != OPT1_SLEEP){
clif_displaymessage(fd, msg_txt(sd,807));
return -1;
}
if(sd->sc.opt1 != OPT1_SLEEP){
sc_start(NULL,&sd->bl, SC_TRICKDEAD, 100, 1, 1000);
sd->sc.opt1 = OPT1_SLEEP;
//sc_start(NULL,&sd->bl, SC_COMA,100,1,skill_get_time2(185,1));
clif_displaymessage(fd, msg_txt(sd,805)); // sleeping
} else {
sd->sc.opt1 = 0;
clif_emotion(&sd->bl,45);
status_change_end(&sd->bl, SC_TRICKDEAD, -1);
//sc_start(NULL,&sd->bl, SC_COMA,100,1,skill_get_time2(185,1));
clif_displaymessage(fd, msg_txt(sd,806)); // awake
}
clif_changeoption(&sd->bl);
return 0;
}
clif_displaymessage(fd, msg_txt(sd,807));
return -1;
}
Can anyone PLEASE help me to make this work?
Share this post
Link to post
Share on other sites