Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Old Scripting Engine (GS1)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-12-2006, 11:22 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Time limitations on auctions

I'm making an auction house on my server that is ran entirely by one NPC. I know how to make everything for bidding and selling, however, the time limit is what's nailing me. I have an idea, but I have to know more first.
1st question-does timevar2 continue to increase, or does it stop at a certain number?
2nd is timevar2 exact seconds? Would lag throw it off?
Ex: would it be safe to say that timevar2+3600 is 1 hour from now?
Thanks!
Reply With Quote
  #2  
Old 03-12-2006, 11:53 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by excaliber7388
1st question-does timevar2 continue to increase, or does it stop at a certain number?
Timevar2 (serverside) keeps going and going. It doesn't stop.


Quote:
Originally Posted by excaliber7388
2nd is timevar2 exact seconds? Would lag throw it off?
It's exact, and very accurate. Measures seconds since 1/1/1970. It even measures within a millionth of a second I believe.


Quote:
Originally Posted by excaliber7388
Ex: would it be safe to say that timevar2+3600 is 1 hour from now?
Thanks!
Yup. Although, I would do int(timevar2) + 3600;

I hope that helped. Good luck with your script.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #3  
Old 03-13-2006, 12:11 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Hrm...I know people hate this but what am i doing wrong?
NPC Code:

if (created)
{
setshape 1,32,32;
}
if(actiontime)
{
triggeraction x,y,timer,#v(int(timevar2));
}
if(actionsell)
{
removeweapon #p(0);
setstring serverr.bid_#p(2)_item,#p(0);
setstring serverr.bid_#p(2)_acct,#p(3);
setstring serverr.bid_#p(2)_img,#p(4);
setstring serverr.bid_#p(2)_price,#p(1);
setstring serverr.bid_#p(2)_time,#v(int(timevar2));
}
if(actionreclaim2)
{
with(getplayer(#s(serverr.bid_#p(1)_acct)))
{
addweapon #s(serverr.bid_#p(0)_item);
}
setstring serverr.bid_#p(0)_item,0;
setstring serverr.bid_#p(0)_acct,0;
setstring serverr.bid_#p(0)_img,0;
setstring serverr.bid_#p(0)_price,0;
}
//#CLIENTSIDE
if(created)
{
timeout=1;
}
if(playerchats)
{
tokenize #c;
//selling
//item name, price, table number, acct, img
if(strequals(#t(0),/sell))
{
if(hasweapon(#t(1)) && !strcontains(#t(1),staff) && strtofloat(#t(2))<100001 && strtofloat(#s(serverr.bid_#t(3)_item))==0 && strtofloat(#t(3))<23 && !strcontains(#t(1),system))
{
triggeraction x,y,sell,#t(1),#t(2),#t(3),#a,#W;
}
else
{
say2 Illegal!;
}
}
}
if(timeout)
{
triggeraction x,y,time,time;
if(actiontimer)
{
for(this.i=0;this.i<20;this.i++)
{
if(strtofloat(#s(serverr.bid_#v(this.i)_time))+(10 )==#p(0))
{
//reclaim2 :this.i, seller account
triggeraction x,y,reclaim2,#v(this.i),#s(serverr.bid_#v(this.i)_ acct);
}
}
}
timeout=1;
}

Reply With Quote
  #4  
Old 03-13-2006, 01:10 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
why don't you try debugging it yourself first? -.-
see if the triggeraction is being called, and etc. seriously, if this trend continues, i think you should be banned from the forums.
__________________
Reply With Quote
  #5  
Old 03-14-2006, 12:30 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
nvm, Fixed it.
Also, is it posible to display the image of a weapon that is not the player's selected weapon?
Reply With Quote
  #6  
Old 03-14-2006, 12:38 AM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
Quote:
Originally Posted by excaliber7388
nvm, Fixed it.
Also, is it posible to display the image of a weapon that is not the player's selected weapon?
#W(index)
__________________
Liek omigosh.

Reply With Quote
  #7  
Old 03-14-2006, 05:12 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Ajira
#W(index)
for the selected weapon, it's just #W I believe.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #8  
Old 03-15-2006, 12:25 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
I would suggest just to do the entire thing serverside.

This generally won't cause lag

timeout = time of auction;

If the auction ends before that
timeout = 0;
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:11 AM.


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