viewing paste onPCLogin Settings NPC | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
//===== rAthena Script =======================================
//= OnPCLogin NPC
//===== By: ==================================================
//= Akkarin
//===== Current Version: =====================================
//= 1.0
//===== Compatible With: =====================================
//= rAthena SVN
//===== Description: =========================================
//= This NPC saves your settings, then next time you login, it
//= will auto perform the commands you selected. Easy to edit
//= or duplicate/modify based on cmds you want to allow.
//===== Additional Comments: =================================
//= 1.0 First Version.
//============================================================
prontera,147,175,5  script  Settings    61,{
    set @n$,"[^484848Settings^000000]";
    set @reset$,"^000000";
    set @disabled$,"^BE1C1C";
    set @enabled$,"^0DB40D";
UserMenu:
    mes @n$;
    mes "You can change the way the game works here...";
    mes "Note: These are all account based, not per-character.";
    mes "Note 2: You must relog for them to take effect.";
    next;
    if (#set_autoloot == 0) set @st_autoloot$,@disabled$+"Off"+@reset$;
    if (#set_autoloot > 0) set @st_autoloot$,@enabled$+#set_autoloot+"%"+@reset$;
    if (#set_showdelay == 0) set @st_showdelay$,@disabled$+"Off"+@reset$;
    if (#set_showdelay > 0) set @st_showdelay$,@enabled$+"On"+@reset$;
    if (#set_showexp == 0) set @st_showexp$,@disabled$+"Off"+@reset$;
    if (#set_showexp > 0) set @st_showexp$,@enabled$+"On"+@reset$;
    if (#set_showzeny == 0) set @st_showzeny$,@disabled$+"Off"+@reset$;
    if (#set_showzeny > 0) set @st_showzeny$,@enabled$+"On"+@reset$;
    if (#set_uptime == 0) set @st_uptime$,@disabled$+"Off"+@reset$;
    if (#set_uptime > 0) set @st_uptime$,@enabled$+"On"+@reset$;
    if (#set_rates == 0) set @st_rates$,@disabled$+"Off"+@reset$;
    if (#set_rates > 0) set @st_rates$,@enabled$+"On"+@reset$;
    menu    "Auto Loot ["+@st_autoloot$+"]",e_autoloot,"Show Delay ["+@st_showdelay$+"]",e_showdelay,"Show Exp ["+@st_showexp$+"]",e_showexp,"Show Zeny ["+@st_showzeny$+"]",e_showzeny,"Uptime on login ["+@st_uptime$+"]",e_uptime,"Rates on login ["+@st_rates$+"]",e_rates;
    close;
e_autoloot:
    mes @n$;
    mes "Auto Loot is currently "+@st_autoloot$;
    mes "Desc: Auto loot adds items to your inventory automatically.";
    next;
    menu "Toggle",-,"Back",UserMenu;
    mes @n$;
    mes "Auto Loot is currently "+@st_autoloot$;
    mes "Enter the minimum rate an item must drop at before it it looted, 100 will loot all items, 99 will only loot cards, 0 disables it.";
    next;
    input @rate;
    if ((@rate >= 0) && (@rate <= 100)) set #set_autoloot,@rate;
    goto UserMenu;
e_showdelay:
    mes @n$;
    mes "Show Delay is currently "+@st_showdelay$;
    mes "Desc: When a skill fails because of delay, it will be hidden.";
    next;
    menu "Toggle",-,"Back",UserMenu;
    if (#set_showdelay == 0) {
        set #set_showdelay,1;
        goto UserMenu;
    }
    if (#set_showdelay == 1) {
        set #set_showdelay,0;
        goto UserMenu;
    }
    set #set_showdelay,1; mes "unknown error"; next; goto UserMenu;
e_rates:
    mes @n$;
    mes "Rates on login is currently "+@st_rates$;
    mes "Desc: Displays the current server rates on login.";
    next;
    menu "Toggle",-,"Back",UserMenu;
    if (#set_rates == 0) {
        set #set_rates,1;
        goto UserMenu;
    }
    if (#set_rates == 1) {
        set #set_rates,0;
        goto UserMenu;
    }
    set #set_rates,1; mes "unknown error"; next; goto UserMenu;
e_showexp:
    mes @n$;
    mes "Show Exp is currently "+@st_showexp$;
    mes "Desc: When you gain exp, it will be displaied.";
    next;
    menu "Toggle",-,"Back",UserMenu;
    if (#set_showexp == 0) {
        set #set_showexp,1;
        goto UserMenu;
    }
    if (#set_showexp == 1) {
        set #set_showexp,0;
        goto UserMenu;
    }
    set #set_showexp,1; mes "unknown error"; next; goto UserMenu;
e_showzeny:
    mes @n$;
    mes "Show Zeny is currently "+@st_showzeny$;
    mes "Desc: When you gain zeny, it will be displaied.";
    next;
    menu "Toggle",-,"Back",UserMenu;
    if (#set_showzeny == 0) {
        set #set_showzeny,1;
        goto UserMenu;
    }
    if (#set_showzeny == 1) {
        set #set_showzeny,0;
        goto UserMenu;
    }
    set #set_showzeny,1; mes "unknown error"; next; goto UserMenu;
e_uptime:
    mes @n$;
    mes "Uptime on login is currently "+@st_uptime$;
    mes "Desc: When you log in, server uptime will be displaied.";
    next;
    menu "Toggle",-,"Back",UserMenu;
    if (#set_uptime == 0) {
        set #set_uptime,1;
        goto UserMenu;
    }
    if (#set_uptime == 1) {
        set #set_uptime,0;
        goto UserMenu;
    }
    set #set_uptime,1; mes "unknown error"; next; goto UserMenu;
close;
 
 
OnPCLoginEvent:
sleep2 1000;
if (#set_autoloot > 0)  atcommand "@autoloot " + #set_autoloot;
if (#set_showdelay == 1)    atcommand "@showdelay";
if (#set_showexp == 1)  atcommand "@showexp";
if (#set_showzeny == 1) atcommand "@showzeny";
if (#set_rates == 1)    atcommand "@rates";
if (#set_uptime == 1)   atcommand "@uptime";
atcommand "@main on";
end;
 
}
Viewed 2032 times, submitted by Akkarin.