Rage Guy Posted June 9, 2013 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 354 Reputation: 3 Joined: 02/17/13 Last Seen: August 14, 2016 Share Posted June 9, 2013 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 Quote Link to comment Share on other sites More sharing options...
Jaburak Posted June 9, 2013 Group: Members Topic Count: 48 Topics Per Day: 0.01 Content Count: 1125 Reputation: 236 Joined: 07/30/12 Last Seen: April 13 Share Posted June 9, 2013 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; } } Quote Link to comment Share on other sites More sharing options...
Rage Guy Posted June 9, 2013 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 354 Reputation: 3 Joined: 02/17/13 Last Seen: August 14, 2016 Author Share Posted June 9, 2013 it got alot of errors == In line 8 Quote Link to comment Share on other sites More sharing options...
Emistry Posted June 9, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted June 9, 2013 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; Quote Link to comment Share on other sites More sharing options...
Rage Guy Posted June 9, 2013 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 354 Reputation: 3 Joined: 02/17/13 Last Seen: August 14, 2016 Author Share Posted June 9, 2013 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 Quote Link to comment Share on other sites More sharing options...
Jaburak Posted June 9, 2013 Group: Members Topic Count: 48 Topics Per Day: 0.01 Content Count: 1125 Reputation: 236 Joined: 07/30/12 Last Seen: April 13 Share Posted June 9, 2013 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; Quote Link to comment Share on other sites More sharing options...
Hades03 Posted June 9, 2013 Group: Members Topic Count: 81 Topics Per Day: 0.02 Content Count: 242 Reputation: 3 Joined: 01/01/12 Last Seen: August 14, 2015 Share Posted June 9, 2013 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? Quote Link to comment Share on other sites More sharing options...
Rage Guy Posted June 9, 2013 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 354 Reputation: 3 Joined: 02/17/13 Last Seen: August 14, 2016 Author Share Posted June 9, 2013 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 Quote Link to comment Share on other sites More sharing options...
Taylor Posted June 9, 2013 Group: Members Topic Count: 15 Topics Per Day: 0.00 Content Count: 36 Reputation: 0 Joined: 05/30/13 Last Seen: January 31, 2014 Share Posted June 9, 2013 (edited) 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 June 9, 2013 by Kristine Quote Link to comment Share on other sites More sharing options...
DeadlySilence Posted June 9, 2013 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 181 Reputation: 53 Joined: 04/07/13 Last Seen: August 23, 2014 Share Posted June 9, 2013 (edited) 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 June 9, 2013 by DeadlySilence Quote Link to comment Share on other sites More sharing options...
Rage Guy Posted June 9, 2013 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 354 Reputation: 3 Joined: 02/17/13 Last Seen: August 14, 2016 Author Share Posted June 9, 2013 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 Quote Link to comment Share on other sites More sharing options...
Capuche Posted June 9, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted June 9, 2013 @SpongeBOB I suggest you to read the Basic_Scripting to be able to fix some small error display by your mapserv. Quote Link to comment Share on other sites More sharing options...
Rage Guy Posted June 9, 2013 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 354 Reputation: 3 Joined: 02/17/13 Last Seen: August 14, 2016 Author Share Posted June 9, 2013 its working but it work for 1 time only == and i want it VENDING Not V E N D I N G Quote Link to comment Share on other sites More sharing options...
DeadlySilence Posted June 9, 2013 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 181 Reputation: 53 Joined: 04/07/13 Last Seen: August 23, 2014 Share Posted June 9, 2013 How about using my script then? It should do exactly what you want. Quote Link to comment Share on other sites More sharing options...
Capuche Posted June 9, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted June 9, 2013 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; } } } Quote Link to comment Share on other sites More sharing options...
Rage Guy Posted June 9, 2013 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 354 Reputation: 3 Joined: 02/17/13 Last Seen: August 14, 2016 Author Share Posted June 9, 2013 Can it be VENDING not V E N D I N G ?? nothing its working thanks Capuchi , thanks Emistry Quote Link to comment Share on other sites More sharing options...
Skorm Posted June 9, 2013 Group: Forum Moderator Topic Count: 33 Topics Per Day: 0.01 Content Count: 1282 Reputation: 393 Joined: 02/03/12 Last Seen: April 11 Share Posted June 9, 2013 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; } 1 Quote Link to comment Share on other sites More sharing options...
Emistry Posted June 10, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted June 10, 2013 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 1 Quote Link to comment Share on other sites More sharing options...
Question
Rage Guy
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.