Giant Whisper Posted February 16, 2020 Posted February 16, 2020 Hello can someone help me with this autoload_atcommand.txt Quote
0 Emistry Posted February 29, 2020 Posted February 29, 2020 // Written by me, Cydh // For rathena.org // Autoload atcommand for players on login prontera,147,155,5 script Kafra#saveyouratcmd 4_F_KAFRA4,{ doevent "autoload_atcommand_main::OnTalk"; } - script script autoload_atcommand_main -1,{ OnTalk: mes .npc$; mes "Hi, you can select command that auto enable when you login."; next; switch(select("Select commands","Close")) { case 1: callsub(OnSelectCommand); break; } close; OnSelectCommand: mes .npc$; mes "Please select command from menu."; .@menu$ = ""; for (.@i = 0; .@i < .CmdListCnt; .@i++) { if (callsub(OnCheckCmd,.CmdList$[.@i]) != -1) { .@st$ = " - ^33CC33Enabled^000000"; } else { .@st$ = " - ^999999Disabled^000000"; } .@menu$ = .@menu$+":"+.CmdList$[.@i]+" "+.@st$; } .@menu$ = .@menu$+":Close"; .@sel = select(.@menu$)-2; if (.@sel != .@i) { .@idx = callsub(OnCheckCmd,.CmdList$[.@sel]); mes "Atcommand ^3399FF"+.CmdList$[.@sel]+"^000000:"; if (.@idx < 0) { // Enable it #AutoAtcommand$[getarraysize(#AutoAtcommand$)] = .CmdList$[.@sel]; mes " ^33CC33Auto-enabled on login^000000"; } else { // Disable it callsub(OnClearRemoveCmd,#AutoAtcommand$[.@idx]); mes " ^FF0000Not enabled on login^000000"; } next; callsub(OnSelectCommand); } return; OnCheckCmd: .@cmd$ = getarg(0); for (.@i = 0; .@i < getarraysize(#AutoAtcommand$); .@i++) { if (#AutoAtcommand$[.@i] == .@cmd$) return .@i; } return -1; OnClearRemoveCmd: .@cmd$ = getarg(0); .@size = getarraysize(#AutoAtcommand$); for (.@i = 0; .@i < .@size; .@i++) { if (#AutoAtcommand$[.@i] == .@cmd$) break; } if (.@i != .@size) { #AutoAtcommand$[.@i] = ""; .@j = 0; for (.@i = 0; .@i < .@size; .@i++) { if (#AutoAtcommand$[.@i] == "") continue; if (.@i != .@j) { #AutoAtcommand$[.@j] = #AutoAtcommand$[.@i]; #AutoAtcommand$[.@i] = ""; } .@j++; } } return 1; OnPCLoginEvent: .@j = 0; for (.@i = 0; .@i < getarraysize(#AutoAtcommand$); .@i++) { if (#AutoAtcommand$[.@i] != "") { dispbottom "[ Auto command: "+#AutoAtcommand$[.@i]+" ]"; atcommand ""+#AutoAtcommand$[.@i]+""; .@j++; } } end; OnInit: .npc$ = "[ Kafra ]"; setarray .CmdList$[0],"@autoloot","@noks","@showexp"; .CmdListCnt = getarraysize(.CmdList$); end; } do something like this if you want to duplicate the npc, split it into 2 NPC scripts are the easiest and less complicated way. Quote
0 Psy Ops Posted February 17, 2020 Posted February 17, 2020 4 hours ago, Giant Whisper said: Hello can someone help me with this autoload_atcommand.txt 2.19 kB · 0 downloads Can you please be specific of the error? Quote
0 Giant Whisper Posted February 17, 2020 Author Posted February 17, 2020 when entering the server it is activate and deactivated Quote
0 LOOLP - OFF Posted February 17, 2020 Posted February 17, 2020 Use OnInit to save your preferences for account variables. Quote
0 Giant Whisper Posted February 17, 2020 Author Posted February 17, 2020 saves them but upon entering they are activated and deactivated as the image shows Quote
0 LOOLP - OFF Posted February 17, 2020 Posted February 17, 2020 I'm not on a computer to code. But there is a lack of a 'stop' in your 'OnPCLoginEvent:' use return at the right time. Because your script is reading all the 'n' commands of the loop Quote
0 Gladius Posted February 18, 2020 Posted February 18, 2020 the script is working perfectly. I believe you may have created many variables in acc_reg_str. You may have created several variables while editing or testing the npc, it happened to me too. Quote
0 Gladius Posted February 19, 2020 Posted February 19, 2020 9 hours ago, Giant Whisper said: and how do I solve it Access your sql database. Go to table acc_reg_str, and delete the autoload regs. The records appear according to the command name. Example: #autoloot. You can delete the line. Quote
0 Giant Whisper Posted February 19, 2020 Author Posted February 19, 2020 already enter and delete the table lines acc_reg_str but the same thing happens even with a new acc Quote
0 Gladius Posted February 23, 2020 Posted February 23, 2020 On 2/19/2020 at 1:29 PM, Giant Whisper said: already enter and delete the table lines acc_reg_str but the same thing happens even with a new acc man, teste the original script please. autoload_atcommand.txt I belive that this work's fine. Quote
0 Giant Whisper Posted February 23, 2020 Author Posted February 23, 2020 problem solved my mistake when duplicating //geffen,125,70,4 duplicate(Kafra Settings#saveyouratcmd) Kafra Settings#saveyouratcmd#1 4_F_KAFRA4 //izlude,139,138,4 duplicate(Kafra Settings#saveyouratcmd) Kafra Settings#saveyouratcmd#2 4_F_KAFRA4 //prontera,148,201,5 duplicate(Kafra Settings#saveyouratcmd) Kafra Settings#saveyouratcmd#3 4_F_KAFRA4 //moscovia,216,190,4 duplicate(Kafra Settings#saveyouratcmd) Kafra Settings#saveyouratcmd#4 4_F_KAFRA4 Quote
Question
Giant Whisper
Hello can someone help me with this
autoload_atcommand.txt
13 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.