Jump to content
  • 0

gold room with timer


Chasewalk

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.02
  • Content Count:  94
  • Reputation:   0
  • Joined:  10/17/20
  • Last Seen:  

Hi there i'm using offline server but how to fix gold room with timer, 12 hours cool down is 43200 seconds  but appears in ingame is 2681696506 seconds then I waited for 12 hours, when I logged in the game I could not enter the gold room because I had to wait after the time. sorry for my bad english,

 

        if (gettimetick(0) < #GOLDROOM_CD) {
            mes "[ ^C6A518Gold Room Assistant^000000 ]";
            mes "You can only re-enter after ^FF0000"+(#GOLDROOM_CD - gettimetick(0))+"^000000 seconds.";
            close2;
            cutin "",255;
            end;
        }
        else if (Zeny < .zeny) {
            mes "[ ^C6A518Gold Room Assistant^000000 ]";
            mes "Sorry, but you can't enter the room.";
            close2;
            cutin "",255;
            end;
        }
        else {
            #GOLDROOM_CD = gettimetick(0) + (12 * 60 * 60); // 12 hours cooldown.
            deltimer strnpcinfo(3)+"::OnKick";
            addtimer (300 * 60 * 1000), strnpcinfo(3)+"::OnKick";
        }
        Zeny -= .zeny;
        warp "ordeal_1-2",151,154;
        end;

gr.png

Edited by Chasewalk
Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  208
  • Reputation:   22
  • Joined:  01/14/13
  • Last Seen:  

You can try this.
 

   
	set .@time,gettimetick(1);
	if( .@time < #GOLDROOM_CD ){
            mes "[ ^C6A518Gold Room Assistant^000000 ]";
            mes "You can only re-enter after ^FF0000"+(#GOLDROOM_CD - gettimetick(0))+"^000000 seconds.";
            mes "Time Gold Room : "+#GOLDROOM_CD;
            close2;
            cutin "",255;
            end;
        }
        else if (Zeny < .zeny) {
            mes "[ ^C6A518Gold Room Assistant^000000 ]";
            mes "Sorry, but you can't enter the room.";
            close2;
            cutin "",255;
            end;
        }
        else {
            set #GOLDROOM_CD,( .@time + ( 3600 * 12 ) ); // 12 hours cooldown.
            deltimer strnpcinfo(3)+"::OnKick";
            addtimer (300 * 60 * 1000), strnpcinfo(3)+"::OnKick";
        }
        Zeny -= .zeny;
        warp "ordeal_1-2",151,154;
        end;

 

Edited by Cookie-rae
update
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.02
  • Content Count:  94
  • Reputation:   0
  • Joined:  10/17/20
  • Last Seen:  

Hi thanks bro but got error

 

[Error]:  Loading NPC file: npc/custom/goldroom.txt
script error on npc/custom/goldroom.txt line 93
    parse_line: expect command, missing function name or calling undeclared function
    88 :                        close2;
    89 :                        cutin "",255;
    90 :                        end;
    91 :                }
    92 :                else {
*   93 :                        '#'GOLDROOM_CD,( .@time + ( 3600 * 12 ) ); // 12 hours cooldown.
    94 :                        deltimer strnpcinfo(3)+"::OnKick";
    95 :                        addtimer (300 * 60 * 1000), strnpcinfo(3)+"::OnKick";
    96 :                }
    97 :                Zeny -= .zeny;
    98 :                warp "ordeal_1-2",151,154;

Edited by Chasewalk
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.02
  • Content Count:  94
  • Reputation:   0
  • Joined:  10/17/20
  • Last Seen:  

same bro not to change time.

gr.png

Edited by Chasewalk
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  208
  • Reputation:   22
  • Joined:  01/14/13
  • Last Seen:  

You can try this 

set .@time,gettimetick(1);
		if( .@time1 < #GOLDROOM_CD1 ){
            mes "[ ^C6A518Gold Room Assistant^000000 ]";
            mes "You can only re-enter after ^FF0000"+#GOLDROOM_CD1+"^000000 seconds.";
            mes "Time Gold Room : "+#GOLDROOM_CD1;
            close;
            cutin "",255;
            end;
        }
		 else if (Zeny < .zeny) {
            mes "[ ^C6A518Gold Room Assistant^000000 ]";
            mes "Sorry, but you can't enter the room.";
            close2;
            cutin "",255;
            end;
        }
        else {
            set #GOLDROOM_CD1,( .@time1 + ( 3600 * 12 ) ); // 12 hours cooldown.
            deltimer strnpcinfo(3)+"::OnKick";
        }
		Zeny -= .zeny;
        warp "ordeal_1-2",151,154;
        end;

Screen Shot

image.png.dc89142026f3a3b03143af3e2774dc35.png

 

On 1/19/2021 at 8:29 PM, Chasewalk said:

same bro not to change time.

 

 

Edited by Cookie-rae
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.02
  • Content Count:  94
  • Reputation:   0
  • Joined:  10/17/20
  • Last Seen:  

thanks sorry late reply for the last time it its ok can u change second into minutes and can u put 300 minutes to display message in script something like this picture thank you for the help

received_880042516163480.webp received_2688910668028186.webp

Screenshot_20210122-230622_1.jpg

Edited by Chasewalk
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  211
  • Reputation:   17
  • Joined:  12/23/11
  • Last Seen:  

mes "You can only re-enter after ^FF0000"+#GOLDROOM_CD1/60+"^000000 min.";

?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.02
  • Content Count:  94
  • Reputation:   0
  • Joined:  10/17/20
  • Last Seen:  

thanks but I want to happen show the 300 minutes to be used inside the gold room

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

On 1/19/2021 at 7:34 PM, Cookie-rae said:

You can try this.
 


   
	set .@time,gettimetick(1);
	if( .@time < #GOLDROOM_CD ){
            mes "[ ^C6A518Gold Room Assistant^000000 ]";
            mes "You can only re-enter after ^FF0000"+(#GOLDROOM_CD - gettimetick(0))+"^000000 seconds.";
            mes "Time Gold Room : "+#GOLDROOM_CD;
            close2;
            cutin "",255;
            end;
        }
        else if (Zeny < .zeny) {
            mes "[ ^C6A518Gold Room Assistant^000000 ]";
            mes "Sorry, but you can't enter the room.";
            close2;
            cutin "",255;
            end;
        }
        else {
            set #GOLDROOM_CD,( .@time + ( 3600 * 12 ) ); // 12 hours cooldown.
            deltimer strnpcinfo(3)+"::OnKick";
            addtimer (300 * 60 * 1000), strnpcinfo(3)+"::OnKick";
        }
        Zeny -= .zeny;
        warp "ordeal_1-2",151,154;
        end;

 

when you die or re enter the goldroom the cooldown will start right away

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  208
  • Reputation:   22
  • Joined:  01/14/13
  • Last Seen:  

On 1/19/2021 at 4:37 PM, Chasewalk said:

        if (gettimetick(0) < #GOLDROOM_CD) {

 

10 minutes ago, kalabasa said:

when you die or re enter the goldroom the cooldown will start right away

It is not my code it was from chasewalk. maybe the set value is keeping him reset.

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