Jump to content
  • 0

Changelog NPC cannot click


awesomazingxed

Question


  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   0
  • Joined:  10/24/14
  • Last Seen:  

2li7v9t.png

/*

CREATE TABLE `changelog` (
  `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  `changelog` VARCHAR(300) NOT NULL,
  `date` VARCHAR(30) NOT NULL,
  `author` VARCHAR(24) NOT NULL,
  PRIMARY KEY (`id`)
)
ENGINE = InnoDB;

*/

maintown,115,85,6	script	Changelogs	837,{
if (getgmlevel() >= .minGMLevel) goto chlog_GM;

// -- Player Menu --
chlog_Player:
mes .npcname$;
mes "Hey choose the Changelog you want to read.";
	// --- Generating Menu ---
	query_sql "SELECT id FROM changelog ORDER BY id DESC LIMIT 1",@chamt;
	@menu$ = "";
	@limit = 0;
	for (@i = @chamt; @i >= 1; @i=@i-1 ) {
	query_sql "SELECT id,changelog,date,author FROM `changelog` WHERE id='"+@i+"'",@id,@changelog$,@date$,@author$;
	query_sql "SELECT COUNT(*) FROM `changelog` WHERE id='"+@i+"'",@check;
	if (@check == 0) continue;
	@id2 = 1+(@id/10);
	@id$ = @id2+"."+(@id%10);
	set @menu$,""+@menu$+"Changelog "+@id$+" [ "+@date$+" ]";
	if (@i >= 1) set @menu$,@menu$+":";
	@limit=@limit+1;
	if(@limit == .loglimit) break;
	}
	// -----------------------
	@pick = select(@menu$);
	next;
	

query_sql "SELECT id FROM `changelog` ORDER by id DESC LIMIT 1 OFFSET "+(@pick-1)+"",@pick;	
query_sql "SELECT id,changelog,date,author FROM `changelog` WHERE id='"+@pick+"'",@id,@changelog$,@date$,@author$;
@id2 = 1+(@id/10);
@id$ = @id2+"."+(@id%10);
@chcount = countstr(@changelog$, "|");
explode(@changelog$, @changelog$, "|");
mes "[Changelog "+@id$+"]";
for (@i = 0; @i < @chcount; @i=@i+1) mes "ï "+@changelog$[@i];
mes " ";
mes "By : "+@author$+"";
next;
mes .npcname$;
mes "Do you want to read other logs ?";
next;
if(select("Yes:No")==1) goto chlog_Player;
mes .npcname$;
mes "Ok, Happy RO ^^";
close;
// -----------------

// -- 	GM Menu	  --
chlog_GM:
@a = 0;
@finish = 0;
mes .npcname$;
mes "Hello Mr. "+strcharinfo(0)+".";
mes "How can I assist you ?";
next;
menu "~ Add a Change Log",chlog_add,
	"~ Edit a Change Log",chlog_edit,
	"~ Remove a Change Log",chlog_rm,	
	"~ Clear all the Change Logs",chlog_clear,
	"~ Open Player Menu",chlog_Player;
	
chlog_add:
// --- Tutorial about adding Change Log --
if (#ch_tutorial != 1) {
ch_tutor:
mes .npcname$;
mes "Okay I guess it's your first time adding changelog. I'll throw you an example.";
next;
mes .npcname$;
mes "This is the example: ";
mes " ";
mes "[^FF0000Changelog 1.1^000000]";
mes "ï ^3661deAdded new monster 'Poring'^000000";
mes "ï ^de8229Pressure now deals 3000 fixed damage^000000";
mes "ï ^3661deRune Knight now rides Lunatic instead of Peco^000000";
mes " ";
mes " ------------- ";
mes "^515151Author: 2essy2killu^000000";
mes "^515151Date: 12-07-1997^000000";
next;
mes .npcname$;
mes "First you are going to add the change points";
mes "From the previous example you are going to add 3 Point";
mes "Added New monster 'poring";
mes " ";
mes "Pressure now deals 3000 fixed damage";
mes " ";
mes "Rune Knight now rides Lunatic instead of Peco";
next;
mes .npcname$;
mes "Date and Author can be removed from the Changelog though from the Configuration menu";
next;
mes .npcname$;
mes "Do you want to hear the tutorial again ?";
next;
menu "Yes",ch_tutor,"No",ch_tutor_x;
ch_tutor_x:
#ch_tutorial = 1;
}
// -----------------------------------------
do {
mes .npcname$;
mes "Input a note:";
if (@a > 0) mes "You have added "+@a+" note(s).";
if (@a > 0) mes "Previous Point : "+@point$[@a-1]+".";
mes " ";
mes "     - Commands -";
mes "input 0 to cancel the whole thing";
mes "input 1 to finish and save";
mes "input 2 to delete the last point";

input @point$[@a];
if(@point$[@a] == "0") { end; }
else if(@point$[@a] == "1") { set @finish,1; }
else if(@point$[@a] == "2") { 
@a=@a-1;
}
else { @a=@a+1; }
next;
} while (@finish != 1);
@pointmerge$ = "";
for( @i = 0; @i < @a; @i=@i+1 ) {
set @pointmerge$,@pointmerge$+""+@point$[@i];
if (@i < @a) set @pointmerge$,@pointmerge$+"|";
}
set @date$,""+gettime(5)+"-"+gettime(6)+"-"+gettime(7)+"";
query_sql "INSERT INTO `changelog` (changelog, date, author) VALUES ('"+@pointmerge$+"','"+@date$+"','"+strcharinfo(0)+"')";
if(.broadcast == 1) announce strcharinfo(0)+" has added a new changelog.",bc_all;
mes .npcname$;
mes "You've successfully added a Change Log";
end;

chlog_edit:
mes .npcname$;
mes "Hey choose the Changelog you want to edit.";
	// --- Generating Menu ---
	query_sql "SELECT id FROM changelog ORDER BY id DESC LIMIT 1",@chamt;
	@menu$ = "";
	for (@i = 1; @i <= @chamt; @i=@i+1 ) {
	query_sql "SELECT id,changelog,date,author FROM `changelog` WHERE id='"+@i+"'",@id,@changelog$,@date$,@author$;
	query_sql "SELECT COUNT(*) FROM `changelog` WHERE id='"+@i+"'",@check;
	if (@check == 0) continue;
	@id2 = 1+(@id/10);
	@id$ = @id2+"."+(@id%10);
	set @menu$,""+@menu$+"Changelog "+@id$+" [ "+@date$+" ]";
	if (@i < @chamt) set @menu$,@menu$+":";
	}
	// -----------------------
	@pick = select(@menu$);
	next;
	do {
	mes .npcname$;
	mes "Input a note:";
	if (@a > 0) mes "You have added "+@a+" note(s).";
	if (@a > 0) mes "Previous Point : "+@point$[@a-1]+".";
	mes " ";
	mes "     - Commands -";
	mes "input 0 to cancel the whole thing";
	mes "input 1 to finish and save";
	mes "input 2 to delete the last point";
	input @point$[@a];
	if(@point$[@a] == "0") { end; }
	else if(@point$[@a] == "1") { set @finish,1; }
	else if(@point$[@a] == "2") { 
	@a=@a-1;
	}
	else { @a=@a+1; }
	next;
	} while (@finish != 1);
	@pointmerge$ = "";
	for( @i = 0; @i < @a; @i=@i+1 ) {
	set @pointmerge$,@pointmerge$+""+@point$[@i];
	if (@i < @a) set @pointmerge$,@pointmerge$+"|";
	}
	set @date$,""+gettime(5)+"-"+gettime(6)+"-"+gettime(7)+"";
	query_sql "SELECT * FROM `changelog` LIMIT 1 OFFSET "+(@pick-1)+"",@pick;
	query_sql "UPDATE `changelog` SET changelog='"+@pointmerge$+"' WHERE id='"+@pick+"'";
	query_sql "SELECT id,changelog,date,author FROM `changelog` WHERE id='"+@pick+"'",@id,@changelog$,@date$,@author$;
	@id2 = 1+(@id/10);
	@id$ = @id2+"."+(@id%10);
	if(.broadcast == 1) announce strcharinfo(0)+" has edited the Changelog "+@id$+".",bc_all;
	mes .npcname$;
	mes "You've successfully edited a Changelog";
	end;
	
chlog_rm:
	mes "Hey choose the Changelog you want to edit.";
	// --- Generating Menu ---
	query_sql "SELECT id FROM changelog ORDER BY id DESC LIMIT 1",@chamt;
	@menu$ = "";
	for (@i = 1; @i <= @chamt; @i=@i+1 ) {
	query_sql "SELECT id,changelog,date,author FROM `changelog` WHERE id='"+@i+"'",@id,@changelog$,@date$,@author$;
	query_sql "SELECT COUNT(*) FROM `changelog` WHERE id='"+@i+"'",@check;
	if (@check == 0) continue;
	@id2 = 1+(@id/10);
	@id$ = @id2+"."+(@id%10);
	set @menu$,""+@menu$+"Changelog "+@id$+" [ "+@date$+" ]";
	if (@i < @chamt) set @menu$,@menu$+":";
	}
	// -----------------------
	next;
	@pick = select(@menu$);
	query_sql "SELECT * FROM `changelog` LIMIT 1 OFFSET "+(@pick-1)+"",@pick;
	query_sql "SELECT id,changelog,date,author FROM `changelog` WHERE id='"+@pick+"'",@id,@changelog$,@date$,@author$;
	@id2 = 1+(@id/10);
	@id$ = @id2+"."+(@id%10);
	query_sql "DELETE from `changelog` WHERE id='"+@pick+"'";
	mes .npcname$;
	mes "You've successfully deleted a Changelog";
	end;

chlog_clear:
mes .npcname$;
mes "^FF0000YOU ARE ABOUT TO REMOVE THE ENTIRE CHANGELOGS YOU'VE MADE";
mes "THIS CAN'T BE REVERTED OR RECOVERED^000000";
mes "Are you sure about this ?";
if(select("No:Yes") == 1) end;
query_sql "DELETE from `changelog` WHERE id>0";
next;
mes .npcname$;
mes "You've successfully deleted the whole changelog.";
end;
// -----------------



OnInit:
// ------------- Inline Configuration -----------------
set .npcname$,"[ ^3a68ffChangelog^000000 ]";
set .minGMLevel,99;		// The minimum level of GM to make, edit, or remove a log.
set .broadcast,1;		// 0=Disabled || 1=Enabled, broadcast when a GM edit / add a Change Log.
set .loglimit,5;		// The Limit of Changelogs displayed
end;
// ----------------------------------------------------
}

And how can i add this.

OnInit:
waitingroom "News & Updates",0;
end;
}

Thanks in advance. 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

I didn't test this one yet.

/*

CREATE TABLE `changelog` (
  `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  `changelog` VARCHAR(300) NOT NULL,
  `date` VARCHAR(30) NOT NULL,
  `author` VARCHAR(24) NOT NULL,
  PRIMARY KEY (`id`)
)
ENGINE = InnoDB;

*/

maintown,115,85,6	script	Changelogs	837,{
if (getgmlevel() >= .minGMLevel) goto chlog_GM;

// -- Player Menu --
chlog_Player:
mes .npcname$;
mes "Hey choose the Changelog you want to read.";
	// --- Generating Menu ---
	query_sql "SELECT id FROM changelog ORDER BY id DESC LIMIT 1",@chamt;
	set .@menu$ = "";
	set .@limit = 0;
	for (@i = @chamt; @i >= 1; @i=@i-1 ) {
	query_sql "SELECT id,changelog,date,author FROM `changelog` WHERE id='"+@i+"'",@id,@changelog$,@date$,@author$;
	query_sql "SELECT COUNT(*) FROM `changelog` WHERE id='"+@i+"'",@check;
	if (@check == 0) continue;
	@id2 = 1+(@id/10);
	@id$ = @id2+"."+(@id%10);
	set .@menu$,""+.@menu$+"Changelog "+@id$+" [ "+@date$+" ]";
	if (@i >= 1) set .@menu$,.@menu$+":";
	@limit=@limit+1;
	if(@limit == .loglimit) break;
	}
	// -----------------------
	@pick = select(@menu$);
	next;
	

query_sql "SELECT id FROM `changelog` ORDER by id DESC LIMIT 1 OFFSET "+(@pick-1)+"",@pick;	
query_sql "SELECT id,changelog,date,author FROM `changelog` WHERE id='"+@pick+"'",@id,@changelog$,@date$,@author$;
@id2 = 1+(@id/10);
@id$ = @id2+"."+(@id%10);
@chcount = countstr(@changelog$, "|");
explode(@changelog$, @changelog$, "|");
mes "[Changelog "+@id$+"]";
for (@i = 0; @i < @chcount; @i=@i+1) mes "ï "+@changelog$[@i];
mes " ";
mes "By : "+@author$+"";
next;
mes .npcname$;
mes "Do you want to read other logs ?";
next;
if(select("Yes:No")==1) goto chlog_Player;
mes .npcname$;
mes "Ok, Happy RO ^^";
close;
// -----------------

// -- 	GM Menu	  --
chlog_GM:
set .@a = 0;
set .@finish = 0;
mes .npcname$;
mes "Hello Mr. "+strcharinfo(0)+".";
mes "How can I assist you ?";
next;
menu "~ Add a Change Log",chlog_add,
	"~ Edit a Change Log",chlog_edit,
	"~ Remove a Change Log",chlog_rm,	
	"~ Clear all the Change Logs",chlog_clear,
	"~ Open Player Menu",chlog_Player;
	
chlog_add:
// --- Tutorial about adding Change Log --
if (#ch_tutorial != 1) {
ch_tutor:
mes .npcname$;
mes "Okay I guess it's your first time adding changelog. I'll throw you an example.";
next;
mes .npcname$;
mes "This is the example: ";
mes " ";
mes "[^FF0000Changelog 1.1^000000]";
mes "ï ^3661deAdded new monster 'Poring'^000000";
mes "ï ^de8229Pressure now deals 3000 fixed damage^000000";
mes "ï ^3661deRune Knight now rides Lunatic instead of Peco^000000";
mes " ";
mes " ------------- ";
mes "^515151Author: 2essy2killu^000000";
mes "^515151Date: 12-07-1997^000000";
next;
mes .npcname$;
mes "First you are going to add the change points";
mes "From the previous example you are going to add 3 Point";
mes "Added New monster 'poring";
mes " ";
mes "Pressure now deals 3000 fixed damage";
mes " ";
mes "Rune Knight now rides Lunatic instead of Peco";
next;
mes .npcname$;
mes "Date and Author can be removed from the Changelog though from the Configuration menu";
next;
mes .npcname$;
mes "Do you want to hear the tutorial again ?";
next;
menu "Yes",ch_tutor,"No",ch_tutor_x;
ch_tutor_x:
#ch_tutorial = 1;
}
// -----------------------------------------
do {
mes .npcname$;
mes "Input a note:";
if (@a > 0) mes "You have added "+@a+" note(s).";
if (@a > 0) mes "Previous Point : "+@point$[@a-1]+".";
mes " ";
mes "     - Commands -";
mes "input 0 to cancel the whole thing";
mes "input 1 to finish and save";
mes "input 2 to delete the last point";

input @point$[@a];
if(@point$[@a] == "0") { end; }
else if(@point$[@a] == "1") { set @finish,1; }
else if(@point$[@a] == "2") { 
@a=@a-1;
}
else { @a=@a+1; }
next;
} while (@finish != 1);
set .@pointmerge$ = "";
for( @i = 0; @i < @a; @i=@i+1 ) {
set .@pointmerge$,.@pointmerge$+""+@point$[@i];
if (@i < @a) set @pointmerge$,@pointmerge$+"|";
}
set @date$,""+gettime(5)+"-"+gettime(6)+"-"+gettime(7)+"";
query_sql "INSERT INTO `changelog` (changelog, date, author) VALUES ('"+@pointmerge$+"','"+@date$+"','"+strcharinfo(0)+"')";
if(.broadcast == 1) announce strcharinfo(0)+" has added a new changelog.",bc_all;
mes .npcname$;
mes "You've successfully added a Change Log";
end;

chlog_edit:
mes .npcname$;
mes "Hey choose the Changelog you want to edit.";
	// --- Generating Menu ---
	query_sql "SELECT id FROM changelog ORDER BY id DESC LIMIT 1",@chamt;
	set .@menu$ = "";
	for (@i = 1; @i <= @chamt; @i=@i+1 ) {
	query_sql "SELECT id,changelog,date,author FROM `changelog` WHERE id='"+@i+"'",@id,@changelog$,@date$,@author$;
	query_sql "SELECT COUNT(*) FROM `changelog` WHERE id='"+@i+"'",@check;
	if (@check == 0) continue;
	@id2 = 1+(@id/10);
	@id$ = @id2+"."+(@id%10);
	set @menu$,""+.@menu$+"Changelog "+@id$+" [ "+@date$+" ]";
	if (@i < @chamt) set .@menu$,.@menu$+":";
	}
	// -----------------------
	set .@pick = select(.@menu$);
	next;
	do {
	mes .npcname$;
	mes "Input a note:";
	if (@a > 0) mes "You have added "+@a+" note(s).";
	if (@a > 0) mes "Previous Point : "+@point$[@a-1]+".";
	mes " ";
	mes "     - Commands -";
	mes "input 0 to cancel the whole thing";
	mes "input 1 to finish and save";
	mes "input 2 to delete the last point";
	input @point$[@a];
	if(@point$[@a] == "0") { end; }
	else if(@point$[@a] == "1") { set @finish,1; }
	else if(@point$[@a] == "2") { 
	@a=@a-1;
	}
	else { @a=@a+1; }
	next;
	} while (@finish != 1);
	set ,@pointmerge$ = "";
	for( @i = 0; @i < @a; @i=@i+1 ) {
	set .@pointmerge$,.@pointmerge$+""+@point$[@i];
	if (@i < @a) set .@pointmerge$,.@pointmerge$+"|";
	}
	set @date$,""+gettime(5)+"-"+gettime(6)+"-"+gettime(7)+"";
	query_sql "SELECT * FROM `changelog` LIMIT 1 OFFSET "+(@pick-1)+"",@pick;
	query_sql "UPDATE `changelog` SET changelog='"+@pointmerge$+"' WHERE id='"+@pick+"'";
	query_sql "SELECT id,changelog,date,author FROM `changelog` WHERE id='"+@pick+"'",@id,@changelog$,@date$,@author$;
	@id2 = 1+(@id/10);
	@id$ = @id2+"."+(@id%10);
	if(.broadcast == 1) announce strcharinfo(0)+" has edited the Changelog "+@id$+".",bc_all;
	mes .npcname$;
	mes "You've successfully edited a Changelog";
	end;
	
chlog_rm:
	mes "Hey choose the Changelog you want to edit.";
	// --- Generating Menu ---
	query_sql "SELECT id FROM changelog ORDER BY id DESC LIMIT 1",@chamt;
	set .@menu$ = "";
	for (@i = 1; @i <= @chamt; @i=@i+1 ) {
	query_sql "SELECT id,changelog,date,author FROM `changelog` WHERE id='"+@i+"'",@id,@changelog$,@date$,@author$;
	query_sql "SELECT COUNT(*) FROM `changelog` WHERE id='"+@i+"'",@check;
	if (@check == 0) continue;
	@id2 = 1+(@id/10);
	@id$ = @id2+"."+(@id%10);
	set .@menu$,""+.@menu$+"Changelog "+@id$+" [ "+@date$+" ]";
	if (@i < @chamt) set @menu$,@menu$+":";
	}
	// -----------------------
	next;
	set .@pick = select(@menu$);
	query_sql "SELECT * FROM `changelog` LIMIT 1 OFFSET "+(@pick-1)+"",@pick;
	query_sql "SELECT id,changelog,date,author FROM `changelog` WHERE id='"+@pick+"'",@id,@changelog$,@date$,@author$;
	@id2 = 1+(@id/10);
	@id$ = @id2+"."+(@id%10);
	query_sql "DELETE from `changelog` WHERE id='"+@pick+"'";
	mes .npcname$;
	mes "You've successfully deleted a Changelog";
	end;

chlog_clear:
mes .npcname$;
mes "^FF0000YOU ARE ABOUT TO REMOVE THE ENTIRE CHANGELOGS YOU'VE MADE";
mes "THIS CAN'T BE REVERTED OR RECOVERED^000000";
mes "Are you sure about this ?";
if(select("No:Yes") == 1) end;
query_sql "DELETE from `changelog` WHERE id>0";
next;
mes .npcname$;
mes "You've successfully deleted the whole changelog.";
end;
// -----------------



OnInit:
// ------------- Inline Configuration -----------------
set .npcname$,"[ ^3a68ffChangelog^000000 ]";
set .minGMLevel,99;		// The minimum level of GM to make, edit, or remove a log.
set .broadcast,1;		// 0=Disabled || 1=Enabled, broadcast when a GM edit / add a Change Log.
set .loglimit,5;		// The Limit of Changelogs displayed
waitingroom "News & Updates",0;
end;
// ----------------------------------------------------
}

add this :

waitingroom "News & Updates",0;

into this line so it will look like this.

set .loglimit,5;		// The Limit of Changelogs displayed
waitingroom "News & Updates",0;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   0
  • Joined:  10/24/14
  • Last Seen:  

Still, it doesn't work. I'm using eathena, by the way. 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   21
  • Joined:  01/31/12
  • Last Seen:  

If you're using eAthena then many of the script commands rAthena uses do not exist. You cannot use definitions such as 

 

@menu$ = "";
 

In eAthena. You must revert all instances of var = value; to set var,value;

In other words: it's time to update to rAthena and this issue, along with many others, will disappear.

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...