Jump to content
  • 0

How to respawn tbox every 1 hour


Question

Posted

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);

 

2 answers to this question

Recommended Posts

  • 0
Posted (edited)
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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...