Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Uhm... (https://forums.graalonline.com/forums/showthread.php?t=18943)

Torankusu 12-15-2001 09:53 AM

Uhm...
 
I need something scripted:

It records the time a FAQ has been on a tag, and resets sunday, twelve PM, am, whatever/after eleven PM. It takes the tags/accounts, etc, out of the "guildFAQ.txt" file (if that is still the name of it). I'd need to be able to view it on my FAQ Chief tag "list times."

It'd show up in a format like the "House Owner Helper!" guy.

Account:Nickname - Hours been on.

If you know how to do this, post in this thread.

royce 12-15-2001 12:38 PM

Are you sure this is possible with the hours next to their name? This is very complicated.

Torankusu 12-15-2001 12:41 PM

I would think so? Classic had something similar to it, but they weren't able to have it like I described it because of no NPC server...

It's a little -faqsystem like NPC, by the way. It goes to their q-list inventory.

T-Squad 12-15-2001 01:59 PM

Oh if its a NPCW then it shouldn't be hard at all.

Torankusu 12-15-2001 02:04 PM

Quote:

Originally posted by T-Squad
Oh if its a NPCW then it shouldn't be hard at all.
Yeah, but it'd link to some NPC Character in a level. It'd have the "view times," etc, commands there... The times the player has been online would come from the NPC, and show up in the NPC Character in a level.

Do you think you could do it? And if you could, would you mind?

entravial 12-15-2001 03:02 PM

~AlphaFlame~

Hmm... non-p2p would use a couple of server. flags and some this.variables... otherwise I dunno...

Note to self: do p2p scripting one day in the next 20 years

Spark910 12-15-2001 04:55 PM

Note to self:Me too.

Tyhm 12-15-2001 10:33 PM

if(strequals(#g,FAQ)){
if(strtofloat(#s(starttime))<1){
setstring starttime,#v(timevar);
}
}else{
if(strtofloat(#s(starttime))<0){
setstring timeontag,#v(strtofloat(#s(timeontag))+(timevar-strtofloat(#s(starttime))));
}}

You can store it manually, and it'll store timeontag as a function of timevar (since it goes up once every like 2 seconds, divide by 30 to get the number of minutes, etc)

TDO2000 12-15-2001 10:46 PM

um it goes up every 5 seconds...

Yakuna2001 12-15-2001 11:56 PM

Quote:

Originally posted by Tyhm
if(strequals(#g,FAQ)){
if(strtofloat(#s(starttime))<1){
setstring starttime,#v(timevar);
}
}else{
if(strtofloat(#s(starttime))<0){
setstring timeontag,#v(strtofloat(#s(timeontag))+(timevar-strtofloat(#s(starttime))));
}}

You can store it manually, and it'll store timeontag as a function of timevar (since it goes up once every like 2 seconds, divide by 30 to get the number of minutes, etc)

tyhm...... u officially own

Torankusu 12-16-2001 03:49 AM

Quote:

Originally posted by Tyhm
if(strequals(#g,FAQ)){
if(strtofloat(#s(starttime))<1){
setstring starttime,#v(timevar);
}
}else{
if(strtofloat(#s(starttime))<0){
setstring timeontag,#v(strtofloat(#s(timeontag))+(timevar-strtofloat(#s(starttime))));
}}

You can store it manually, and it'll store timeontag as a function of timevar (since it goes up once every like 2 seconds, divide by 30 to get the number of minutes, etc)

I suck at scripting. What would go in the NPC that I say "list times" that shows the time each faq with that NPC has been online?

Tyhm 12-16-2001 04:20 AM

NPC Code:

if(strequals(#g,FAQ)){
if(strtofloat(#s(starttime))<1){
setstring starttime,#v(timevar);
}else if((timevar- strtofloat(#s(starttime)))+ strtofloat(#s(server.#atimeontag)) > 60){ setstring server.#atimeontag,#v( strtofloat(#s(server.#atimeontag)) + (timevar- strtofloat(#s(starttime))));
setstring starttime,#v(timevar);
}else{
if(strtofloat(#s(starttime))<0){
setstring server.#atimeontag,#v(strtofloat(#s(server.#atimeo ntag))+(timevar-strtofloat(#s(starttime))));
}
}


SHOULD update the server.[accountname]timeontag string every five minutes, assuming it is indeed 5 seconds per click.
NPC Code:

if(playerenters&&strequals(#g,FAQ Chief)) toweapons FAQ Checker;
if(playerchats&&strequals(#w,FAQ Checker)){
setcharprop #n,#c;
this.clicks=strtofloat(#s(server.#ctimeontag));
this.minutes=(this.clicks/12)%60;
this.hours=(this.clicks/720);
setplayerprop #c,#c: #v(this.hours) : #v(this.minutes) : #v((this.clicks%12)*5);
//setstring server.#ctimeontag,0;
}


Should report the H:M:S assuming 5 seconds per click - otherwise you can redo the math however you like. Uncomment the last line and it'll reset the time since last check; either way you're gonna have to record it, either how much time they put in last time you checked or what the last time you checked was. It'd be rude if you checked it (thereby clearing it), then checked again five minutes later and fired them for not coming on at all!

Torankusu 12-16-2001 04:33 AM

1 Attachment(s)
Okay,
It shows up as (see attatched.)

Torankusu 12-16-2001 04:35 AM

1 Attachment(s)
But it needs to be like this. (see attatched.)

The other stuff works fine.

Torankusu 12-16-2001 04:39 AM

1 Attachment(s)
The "online" in that last one should be "on tag this week."

I'd need it to show up as something like in the screenshot attatched. Account Hours, Minutes, Seconds, etc.

Tyhm 12-16-2001 10:17 AM

Hm, golly gee, in that case SCRIPT IT YOURSELF! Geeze, some people...give 'em an inch...*grumble grumble don't even work for this server grumble*

Torankusu 12-16-2001 10:44 AM

:(

Sorry, sorry.

I can't script at all. Maybe I could get that one script from loriel, and then go from there.

Thanks for that one script, tyhm.

ShockwaveISTHEBEST 12-18-2001 02:33 AM

Tyhm, your pretty damn good at this whole scripting bit.:eek:

btedji 12-18-2001 03:59 AM

Arg use string arrays you people

Saga2001 12-19-2001 12:16 AM

This is with npc server?
 
if this is with npcserver, can't u use a with?
like:
NPC Code:

/*
you could just do something like make accounts like:
setstring server.faqacc1,accountname;
so lets make believe you have 2 faqs.
*/
Database NPC / Source NPC:
if (created||initialized) {
setstring server.faqacc0,accountname;
setstring server.faqacc1,accountname;
// this.maxaccounts should be the highest numer you have in the list...so for this example the maxaccnts is 1...
this.maxaccnts = 1;
this.i = 0;
}
while (this.i<this.maxaccnts) {
with(getplayer(#s(server.faqacc#v(this.i)))) {
if (strequals(#g,FAQ)&&strlen(#s(server.faqaccon#v(th is.i)))<1) {
setstring server.faqaccon,#v(timevar);
} else if (!strequals(#g,FAQ)&&strlen(#s(server.faqaccon#v(t his.i)))>0) {
this.starttime = strtofloat(#s(server.faqaccon#v(this.i)));
setstring server.faqaccon#v(this.i),;
this.currtime = timevar;
this.hastime = strtofloat(#s(server.faqacctime#v(this.i)));
this.newtime = (this.currtime-this.starttime)+this.hastime;
setstring server.faqacctime,#v(this.newtime);
this.i++;
}
}
sleep .1;
}
while (this.i>=this.maxaccnts) {this.i=0;sleep .1;}
if (actionserverCheckTime) {
this.j=0;
while (this.j<this.maxaccnts) {
showimg this.j+500,@#s(server.faqacc#v(this.j)): #s(server.faqacctime#v(this.j)),10,100+(this.j*15) ;
changeimgvis this.j+500;
this.j++;
}
}

The NPC Used to Check times:
if (playertouchsme) toweapons Time Check;
if (playerchats&&strequals(Check FAQ Times,#c)) {triggeraction 0,0,serverCheckTime,;}



Its mostly done, i haven't tested it, i am still at school...it looks pretty good..should work... someone test it and tell me...ok? looks pretty good to me. :)
-PastAustin

Saga2001 12-19-2001 03:55 AM

someone
 
does this look right? i am tired...i think it looks good...
yeah?


All times are GMT +2. The time now is 03:04 PM.

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