Jump to content
  • 0

How to respawn tbox every 1 hour


Jinun

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  4
  • Reputation:   0
  • Joined:  02/15/21
  • Last Seen:  

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

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  255
  • Reputation:   232
  • Joined:  07/24/13
  • Last Seen:  

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

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  4
  • Reputation:   0
  • Joined:  02/15/21
  • Last Seen:  

Thank you mate I will try this one.

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