Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Using my really really limited NPC scripting skills, I made a sign chat NPC. (https://forums.graalonline.com/forums/showthread.php?t=13668)

freddyfox 10-03-2001 05:30 AM

Using my really really limited NPC scripting skills, I made a sign chat NPC.
 
NPC Code:

if (playerenters) {
toweapons Sign Chatting;
}
if(playerchats){
say2 #c;
}



Look at how long it took me to put that together.

Metal-Slug 10-03-2001 05:32 AM

omg, the day freddy surpases us all in scrpting abilities, *kills self*

no, just kidding, hehehehe

IceHawk 10-03-2001 05:58 AM

merlinerereR:
as a npcw it would only be local
so try

if (playerchats) {
if (tokenscount<12) {
setstring level.chat,#t(0) #t(1) #t(2);
setstring level.chat2 #t(3) #t(4) #t(5);
setstring level.chat3 #t(6) #t(7) #t(8);
setstring level.chat4 #t(9) #t(10) #t(11);
timeout = .2;
elseif (tokenscount>11) {
say2 Text was too big!;
}
}
if (timeout) {
say2 #s(level.chat)#b
#s(level.chat2)#b
#s(level.chat3)#b
#s(level.chat4)#b
}

i'm sure there's a better way to do it, though ;/

freddyfox 10-03-2001 06:01 AM

Quote:

Originally posted by IceHawk


if (playerchats) {
if (tokenscount<12) {
setstring level.chat,#t(0) #t(1) #t(2);
setstring level.chat2 #t(3) #t(4) #t(5);
setstring level.chat3 #t(6) #t(7) #t(8);
setstring level.chat4 #t(9) #t(10) #t(11);
timeout = .2;
elseif (tokenscount>11) {
say2 Text was too big!;
}
}
if (timeout) {
say2 #s(level.chat)#b
#s(level.chat2)#b
#s(level.chat3)#b
#s(level.chat4)#b
}

I use local because NPCServer scripting is alien to me.

entravial 10-03-2001 09:58 AM

~AlphaFlame~

Hi kiddies. Here's the ultimate lag-your-server script. Enjoy.

NPC Code:

if (created && strtofloat(#s(server.msgbrd))=0){
setstring server.msgbrd,0;
}

if (playerchats && startswith(post:,#c)){
this.length=0;
this.l2=0;
tokenize #c;
setstring this.post,#a: ;
this.length+=strlen(#a)+2;
for (this.t=1;this.t<tokenscount;this.t++){
setstring this.post,#s(this.post) #t(this.t);
this.length+=strlen(#t(this.t));
}
this.startpage=strtofloat(#s(server.msgbrd));
this.pages=int(this.length/32+1)+this.startpage;
for (this.page=this.startpage;this.page<this.pages;thi s.page++){
setstring server.page#v(this.pages),#e(this.l2,32,#s(this.po st));
this.l2+=32;
}
setstring server.msgbrd,#v(strtofloat(#s(msgbrd))+this.pages )
}
if (playerchats && strequals(#c,read board)){
this.readpage=3;
say2 #s(server.page#v(this.readpage-2))
#b#s(server.page#v(this.readpage-1))
#b#s(server.page#v(this.readpage));
}
if (playerendsreading && this.readpage<strtofloat(#s(server.msgbrd))){
this.readpage+=3;
say2 #s(server.page#v(this.readpage-2))
#b#s(server.page#v(this.readpage-1))
#b#s(server.page#v(this.readpage));
}




And nobody raise hell over how its scripted... :p

btedji 10-03-2001 07:13 PM

hahaha thats funny


All times are GMT +2. The time now is 02:15 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.