Jump to content
  • 0

Chat Room NPC


Rage Guy

Question


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

i want npc opening a chat room but not normal one

Only NPC - Standing And over it a room

example : the word is [ Vending ]

 

1 sec

 

V

 

1 sec

 

VE

 

1 sec

 

VEN

 

1 sec

 

VEND

 

1 sec

 

VENDI

 

1 sec

 

VENDIN

 

1 sec

 

VENDING

 

Then start over From V

Link to comment
Share on other sites

17 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1125
  • Reputation:   236
  • Joined:  07/30/12
  • Last Seen:  


prontera,155,150,0 script Test 123,{

end;

OnInit:

set .message$, "VENDING";

while (1) {

set .message$, delchar(.message$+charat(.message$,0),0);

delwaitingroom;

waitingroom .message$, 0;

sleep 1000;

}

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

it got alot of errors ==



In line 8

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

try


OnInit:
setarray .alphabets$,"V","E","N","D","I","N","G";
set .alphabets_size,getarraysize( .alphabets );
while( 1 ){
	set .@title$,.@title$ +" "+ .alphabets$[.@i];
	set .@i,.@i + 1;
	delwaitingroom;
	waitingroom ""+.@title$,0;
	sleep 1000;
	if( .@i % 8 == 0 ) set .@title$,"";
}
end;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

prontera,155,150,0    script    Test    123,{
    end;
    

OnInit:
setarray .alphabets$,"V","E","N","D","I","N","G";
set .alphabets_size,getarraysize( .alphabets );
while( 1 ){
    set .@title$,.@title$ +" "+ .alphabets$[.@i];
    set .@i,.@i + 1;
    delwaitingroom;
    waitingroom ""+.@title$,0;
    sleep 1000;
    if( .@i % 8 == 0 ) set .@title$,"";
}
end;
 

Error at line 1

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1125
  • Reputation:   236
  • Joined:  07/30/12
  • Last Seen:  


prontera,155,150,0 script Test 123,{

end;

OnInit:

setarray .alphabets$,"V","E","N","D","I","N","G";

set .alphabets_size,getarraysize( .alphabets );

while( 1 ){

set .@title$,.@title$ +" "+ .alphabets$[.@i];

set .@i,.@i + 1;

delwaitingroom;

waitingroom ""+.@title$,0;

sleep 1000;

if( .@i % 8 == 0 ) set .@title$,"";

}

end;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  242
  • Reputation:   3
  • Joined:  01/01/12
  • Last Seen:  

prontera,155,150,0 script Vending 123,{

OnInit:

setarray .alphabets$,"V","E","N","D","I","N","G";

set .alphabets_size,getarraysize( .alphabets );

while( 1 ){

set .@title$,.@title$ +" "+ .alphabets$[.@i];

set .@i,.@i + 1;

delwaitingroom;

waitingroom ""+.@title$,0;

sleep 1000;

if( .@i % 8 == 0 ) set .@title$,"";

}

end;

prontera,155,150,0 script Test 123,{

end; <<-- for what?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

prontera,155,150,0	script	Test	123,{
OnInit:
setarray .alphabets$,"V","E","N","D","I","N","G";
set .alphabets_size,getarraysize( .alphabets );
while( 1 ){
	set .@title$,.@title$ +" "+ .alphabets$[.@i];
	set .@i,.@i + 1;
	delwaitingroom;
	waitingroom ""+.@title$,0;
	sleep 1000;
	if( .@i % 8 == 0 ) set .@title$,"";
}
end;

Not working

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   0
  • Joined:  05/30/13
  • Last Seen:  

prontera,155,150,0    script    Test    123,{
    end;
    

OnInit:
setarray .alphabets$,"V","E","N","D","I","N","G";
set .alphabets_size,getarraysize( .alphabets );
while( 1 ){
    set .@title$,.@title$ +" "+ .alphabets$[.@i];
    set .@i,.@i + 1;
    delwaitingroom;
    waitingroom ""+.@title$,0;
    sleep 1000;
    if( .@i % 8 == 0 ) set .@title$,"";
}
end;
 

Error at line 1

 

 

Mr. Emistry gave you a working script, you just need to use tab and troubleshoot a little. As you can see its just missing a }

test_vend.txt

Edited by Kristine
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  181
  • Reputation:   53
  • Joined:  04/07/13
  • Last Seen:  


prontera,155,150,0 script Test 123,{

// end the script in case someone talks to the NPC

end;

OnInit:

// set the chat's name's characters

setarray .chars$, "V", "E", "N", "D", "I", "N", "G";

// infinity loop, yay

while (1) {

// loop through all the characters

for (.@i = 0; .@i < getarraysize(.chars$); .@i += 1) {

// reset name on first run or after a complete run

if (0 == .@i) {

.@chatName$ = "";

}

.@chatName$ = .@chatName$ + .chars$[.@i];

waitingroom(.@chatName$, 0);

sleep(1000);

delwaitingroom;

}

}

}

Edited by DeadlySilence
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

prontera,155,150,0	script	Test	123,{
    end;
    

OnInit:
setarray .alphabets$,"V","E","N","D","I","N","G";
set .alphabets_size,getarraysize( .alphabets );
while( 1 ){
    set .@title$,.@title$ +" "+ .alphabets$[.@i];
    set .@i,.@i + 1;
    delwaitingroom;
    waitingroom ""+.@title$,0;
    sleep 1000;
    if( .@i % 8 == 0 ) set .@title$,"";
}
end;
}

it only comes for 1 time then nothing comes

i want it reload automatic

after

 VENDING

Start over

 

and i want it VENDING not V E N D I N G

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

@SpongeBOB

I suggest you to read the Basic_Scripting to be able to fix some small error display by your mapserv.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

its working but

it work for 1 time only

==

 

and i want it

VENDING Not V E N D I N G

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  181
  • Reputation:   53
  • Joined:  04/07/13
  • Last Seen:  

How about using my script then?

It should do exactly what you want.

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Yeah DeadlySilence's script is working

 

Emistry's script doesn't work coz .@i is not reset

prontera,155,150,0	script	Test	123,{
    end;
    

OnInit:
setarray .alphabets$,"V","E","N","D","I","N","G";
while( 1 ){
    set .@title$,.@title$ + .alphabets$[.@i];
    set .@i,.@i + 1;
    delwaitingroom;
    waitingroom ""+.@title$,0;
    sleep 1000;
    if( .@i % 8 == 0 ) {
		set .@title$,"";
		set .@i, 0;
	}
}
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

Can it be

VENDING not V E N D I N G ??



nothing

its working

 

thanks Capuchi , thanks Emistry

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Looks dude it's a lot of extra work just to put the variable not spaced out like that... Completely pointless but ... yeah.

prontera,155,150,0	script	Test	123,{

end;

OnInit:

set .alphabets$,"VENDING";

set .i,callfunc("str_toarray", .alphabets$, "$@alphabets$[0]");

copyarray .alphabets$[0], $@alphabets$[0], .i;

deletearray $@alphabets$[0],128;

while( 1 ){

set .@title$,.@title$ + .alphabets$[.@i];

set .@i,.@i + 1;

delwaitingroom;

waitingroom ""+.@title$,0;

sleep 1000;

if( .@i % 8 == 0 ) {

set .@title$,"";

set .@i, 0;

}

}

}

///callfunc "str_toarray", "<string>", "<array output>";

function script str_toarray {

sleep2 1;

if ( getstrlen( getarg(0) ) > 128 ) return 0;

setarray .@char$[ 0 ],

" ", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",

"E", "I", "A", "S", "R", "N", "T", "O", "U", "L", "C",

"P", "M", "D", "V", "H", "G", "F", "B", "Y", "Q", "K",

"Z", "X", "J", "W", "_", "-";

set .@charsize, getarraysize(.@char$);

set .@tmp$, "|~key~|";

set .@str$, .@tmp$ + getarg(0) ;

set .@len, getstrlen(getarg(0));

while( .@len>.@s ) {

set .@i,0;

while( .@i<.@charsize ) {

if ( ! ( set(.@l,.@l+1) % 650) )

sleep2 1;

if ( compare( .@str$ , .@tmp$ + .@char$[.@i] ) ) {

set .@tmp$, .@tmp$ + .@char$[.@i];

set .@arr$[.@s], .@char$[.@i];

break;

}

set .@i, .@i+1;

}

if ( .@i == .@charsize ) return 0;

else set .@s, .@s+1;

}

deletearray getd(getarg(1));

copyarray getd(getarg(1)), .@arr$, .@len;

return .@len;

}

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

OnInit:
setarray .alphabets$,"V","E","N","D","I","N","G";
set .alphabets_size,getarraysize( .alphabets$ );
while( 1 ){
	set .@title$,.@title$ + .alphabets$[.@i%.alphabets_size];
	set .@i,.@i + 1;
	delwaitingroom;
	waitingroom ""+.@title$,0;
	sleep 100;
	if( .@i % .alphabets_size == 0 ) set .@title$,"";
}
end;

 

just some minor mistake in variable name ....and array index

  • Upvote 1
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...