Jump to content
  • 0
Jinun

How to respawn tbox every 1 hour

Question

Can Anyone help me to convert this code at rathena scripting code.
I am not good at rathena scripting but still in learning.

I've write this code in Javascript

I want to respawn the Treasure Box chest at prontera every 1 hour

just the concept of setInterval, How Do I write that?

setInterval(function() {
    // this is a scripting of rathena
    // I know this line of code how it works
    monster "prontera",0,0,"Treasure Box",2288,1,"Treasure Box Respawner::OnTBoxDestroyed";
    OnTBoxDestroyed:
        $TBoxDestroyed++;
        if ($TBoxDestroyed > 0) {
            announce "The Treasure box has been destroyed by " + strcharinfo(0) + "!",3;
            $TBoxDestroyed = 0;
        }
        end;

},1000 * 60 * 60 * 1);

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
5 hours ago, Jinun said:

Can Anyone help me to convert this code at rathena scripting code.
I am not good at rathena scripting but still in learning.

I've write this code in Javascript

I want to respawn the Treasure Box chest at prontera every 1 hour

just the concept of setInterval, How Do I write that?

setInterval(function() {
    // this is a scripting of rathena
    // I know this line of code how it works
    monster "prontera",0,0,"Treasure Box",2288,1,"Treasure Box Respawner::OnTBoxDestroyed";
    OnTBoxDestroyed:
        $TBoxDestroyed++;
        if ($TBoxDestroyed > 0) {
            announce "The Treasure box has been destroyed by " + strcharinfo(0) + "!",3;
            $TBoxDestroyed = 0;
        }
        end;

},1000 * 60 * 60 * 1);

 

-	script	Treasure Box Respawner	-1,{
OnMinute00:
	monster "prontera",0,0,"Treasure Box",2288,1,"Treasure Box Respawner::OnTBoxDestroyed";
	end;

OnTBoxDestroyed:
	announce "The Treasure box has been destroyed by " + strcharinfo(0) + "!",3;
	end;
}

https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L857

Edited by Balfear
  • Upvote 1
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...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.