Jump to content
  • 0

Overflow


Mootie

Question


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  815
  • Reputation:   86
  • Joined:  10/26/12
  • Last Seen:  

prontera,155,181,5    script    Sample    757,{
mes "Wan to be Premium Users for 1 week ?";
mes "Then give me "+.Amount+" x "+getitemname(.ItemID);
if( countitem( .ItemID ) >= .Amount ){
   if( select("YES:NO") == 1 ){
       delitem .ItemID,.Amount;
       set #PremiumUser,gettimetick(2) + ( .Day * 3600 * 24 );
       sc_start SC_ITEMBOOST,( #PremiumUser * 1000 ),200;
       sc_start SC_EXPBOOST,( #PremiumUser * 1000 ),200;
       mes "Done. enjoy your Premium Services for 1 Week.";
   }
}
close;

OnPCLoginEvent:
if( #PremiumUser > gettimetick(2) ){
   sc_start SC_ITEMBOOST,( ( #PremiumUser - gettimetick(2) ) * 1000 ),200;
   sc_start SC_EXPBOOST,( ( #PremiumUser - gettimetick(2) ) * 1000 ),200;
}
end;
}

post-9398-0-89388500-1353169559_thumb.png

i already set

    sc_start SC_ITEMBOOST,( #PremiumUser * 50 ),30;
    sc_start SC_EXPBOOST,( #PremiumUser * 50 ),30;

still overflowing o.o

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Max int is 2147483648, your script produces 13531694210 (magnitude of 10 higher).

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

That cause you already have 1M from getttick and multiply by 50 but int32 it's limited to 2M when signed.

Don'T get exactly why you giving such a big value on SC_ITEMBOOST and SC_EXPBOOST, what are you trying to do ?, the 1st argument is the ending tick wich I guess you already set by doing gettick+day... so why *1000 again ?

That cause you already have 1M from getttick and multiply by 50 but int32 it's limited to 2M when signed.

Don'T get exactly why you giving such a big value on SC_ITEMBOOST and SC_EXPBOOST, what are you trying to do ?, the 1st argument is the ending tick wich I guess you already set by doing gettick+day... so why *1000 again ?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

in your OnPCLoginEvent there...already show you a working method...

sc_start SC_ITEMBOOST,( ( #PremiumUser - gettimetick(2) ) * 1000 ),200;
sc_start SC_EXPBOOST,( ( #PremiumUser - gettimetick(2) ) * 1000 ),200;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  815
  • Reputation:   86
  • Joined:  10/26/12
  • Last Seen:  

to prevent the overflowing what i need to do? change entire script? or re-edit something.... i already tryed all i know about scripting still nube /whisp

@emis

actually i get thisc script on http://upaste.me/851341191e32f77 made by you and i made some editing usual so boom overflow

also possible for mvp card drop rate to be affect?

Edited by Mootie
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  71
  • Reputation:   25
  • Joined:  11/23/11
  • Last Seen:  

prontera,155,181,5	script	Sample	757,{
mes "Wan to be Premium Users for 1 week ?";
mes "Then give me "+.Amount+" x "+getitemname(.ItemID);
if( countitem( .ItemID ) >= .Amount ){
	if( select("YES:NO") == 1 ){
		delitem .ItemID,.Amount;
		set #PremiumUser,gettimetick(2) + ( .Day * 3600 * 24 );
	    doevent "Sample::OnPCLoginEvent";
		mes "Done. enjoy your Premium Services for 1 Week.";
	}
}
close;

OnPCLoginEvent:
if( #PremiumUser > gettimetick(2) ){
	set .@t,#PremiumUser-gettimetick(2);
	if( .@t >= 3600 ){
		addtimer 3600000,"Sample::OnPCLoginEvent";
		set .@d,3600;
	}
	else{
		addtimer .@t * 1000,"Sample::OnPCLoginEvent";
		set .@d,.@t;
	}
	sc_start SC_ITEMBOOST,.@d * 1000,200;
	sc_start SC_EXPBOOST,.@d * 1000,200;
}
end;
}

Edited by Omnipotent
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

@Mootie

ya i know..i remember i made it ( and i remember i post a fixed one somewhere in forum i think )..

anyway the previous post i made is just to let you know there is already a "working" sample inside the script...

all you have to do is just follow the same way ....

in your script...the part you edit....you just do it in a wrong way only...

and for the mvp card drop rate....

the sc_itemboost will affect All items include card , item , equipment and etc......

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...