Jump to content
  • 0

Hourly Points Problem


TiMz

Question


  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  192
  • Reputation:   9
  • Joined:  05/08/13
  • Last Seen:  

So the script was working for SVN 17+ but when I downgraded back to 16+, I keep getting errors such as

 


[Error]: npc_parsesrcfile: Unknown syntax in file 'npc/abc/hourpoints2.txt', line '1'. Stopping...
 * w1=- script hourlypoints -1,{
 * w2=
 * w3=
 * w4=

 

Here's the script I'm using.

 

- script hourlypoints -1,{

//--Start of the Script
OnPCLoginEvent:
attachnpctimer ""+strcharinfo(0)+"";
initnpctimer;
end;

OnTimer60000:
set @minute, @minute + 1;
if(@minute == 20){
set @minute,0;
set .@point_amt, 2; //Points to get every hour (default: 10)
if(checkVending()== 1) {
dispbottom "The hourly points event haulted because you were vending, chatting, or idle.";
stopnpctimer;
end;
}
else {
set #CASHPOINTS, #CASHPOINTS + .@point_amt;
dispbottom "You received "+.@point_amt+" cash points for staying in-game for 20 minutes.";
dispbottom "Current Balance = "+#CASHPOINTS+" Cash Points";
set @consecutive_hour, @consecutive_hour + 1;
}
}
if(@consecutive_hour == 1) {
set @consecutive_hour,0;
set .@cpoint_amt, 10; //Points to get for 12 Consecutive hours (default: 50)
set #CASHPOINTS, #CASHPOINTS + .@point_amt;
dispbottom "You received "+.@cpoint_amt+" bonus cash points for playing for 1 hour.";
dispbottom "Current Balance = "+.@point_var$+" Cash Points";
}
stopnpctimer;
initnpctimer;
end;

}
//--End of the Script

 

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  764
  • Reputation:   220
  • Joined:  11/14/11
  • Last Seen:  

Use tabulators instead of spaces to separate the fields in the NPC header (line 1).

-%TAB%script%TAB%hourlypoints%TAB%-1,{
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

So the script was working for SVN 17+ but when I downgraded back to 16+, I keep getting errors such as

 


[Error]: npc_parsesrcfile: Unknown syntax in file 'npc/abc/hourpoints2.txt', line '1'. Stopping...
 * w1=- script hourlypoints -1,{
 * w2=
 * w3=
 * w4=

 

Here's the script I'm using.

 

- script hourlypoints -1,{

//--Start of the Script
OnPCLoginEvent:
attachnpctimer ""+strcharinfo(0)+"";
initnpctimer;
end;

OnTimer60000:
set @minute, @minute + 1;
if(@minute == 20){
set @minute,0;
set .@point_amt, 2; //Points to get every hour (default: 10)
if(checkVending()== 1) {
dispbottom "The hourly points event haulted because you were vending, chatting, or idle.";
stopnpctimer;
end;
}
else {
set #CASHPOINTS, #CASHPOINTS + .@point_amt;
dispbottom "You received "+.@point_amt+" cash points for staying in-game for 20 minutes.";
dispbottom "Current Balance = "+#CASHPOINTS+" Cash Points";
set @consecutive_hour, @consecutive_hour + 1;
}
}
if(@consecutive_hour == 1) {
set @consecutive_hour,0;
set .@cpoint_amt, 10; //Points to get for 12 Consecutive hours (default: 50)
set #CASHPOINTS, #CASHPOINTS + .@point_amt;
dispbottom "You received "+.@cpoint_amt+" bonus cash points for playing for 1 hour.";
dispbottom "Current Balance = "+.@point_var$+" Cash Points";
}
stopnpctimer;
initnpctimer;
end;

}
//--End of the Script

 

Hello, i'm pretty sure that the problem is that in the line 1 you did not tabbed, just hit tab betwin the spaces on the line 1 like this and you should not have any errors

-<tab>script<tab>hourlypoints<tab>-1,{

So the script was working for SVN 17+ but when I downgraded back to 16+, I keep getting errors such as

 


[Error]: npc_parsesrcfile: Unknown syntax in file 'npc/abc/hourpoints2.txt', line '1'. Stopping...
 * w1=- script hourlypoints -1,{
 * w2=
 * w3=
 * w4=

 

Here's the script I'm using.

 

- script hourlypoints -1,{

//--Start of the Script
OnPCLoginEvent:
attachnpctimer ""+strcharinfo(0)+"";
initnpctimer;
end;

OnTimer60000:
set @minute, @minute + 1;
if(@minute == 20){
set @minute,0;
set .@point_amt, 2; //Points to get every hour (default: 10)
if(checkVending()== 1) {
dispbottom "The hourly points event haulted because you were vending, chatting, or idle.";
stopnpctimer;
end;
}
else {
set #CASHPOINTS, #CASHPOINTS + .@point_amt;
dispbottom "You received "+.@point_amt+" cash points for staying in-game for 20 minutes.";
dispbottom "Current Balance = "+#CASHPOINTS+" Cash Points";
set @consecutive_hour, @consecutive_hour + 1;
}
}
if(@consecutive_hour == 1) {
set @consecutive_hour,0;
set .@cpoint_amt, 10; //Points to get for 12 Consecutive hours (default: 50)
set #CASHPOINTS, #CASHPOINTS + .@point_amt;
dispbottom "You received "+.@cpoint_amt+" bonus cash points for playing for 1 hour.";
dispbottom "Current Balance = "+.@point_var$+" Cash Points";
}
stopnpctimer;
initnpctimer;
end;

}
//--End of the Script

 

Hello, i'm pretty sure that the problem is that in the line 1 you did not tabbed, just hit tab betwin the spaces on the line 1 like this and you should not have any errors

-<tab>script<tab>hourlypoints<tab>-1,{

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  82
  • Reputation:   1
  • Joined:  04/30/13
  • Last Seen:  

Replace the spaces in the header with tabs.

 

-<TAB>script<TAB>hourlypoints<TAB>-1,{

 

EDIT: Oh wow... I'm late at posting. x.x

Edited by rqueen
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...