Jump to content
  • 0

putting delay after use on bind command


AinsLord

Question


  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

so i was trying to put like 5 secs delay on binded command i dunno if im doing it right seems got errors

any one can help

this is the script

-	script	maintown	-1,{
OnInit:
	bindatcmd "maintown",strnpcinfo(3)+"::OnAtcommand";
	end;


OnCommand:

    if(gettimetic(2) < cooldowntime ){
        dispbottom "Please wait 5 seconds!";
        end;
    }
    atcommand "@maintown";
    set cooldowntime,gettimetic(2)+5;

    end;

OnAtcommand:
	atcommand "@warp alexandria 158 144";
	end;
}

thanks in advance

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  63
  • Reputation:   35
  • Joined:  07/04/19
  • Last Seen:  

1 hour ago, AinsLord said:

i tried but i got this error

image.png.9373877ce95121e451e870b3b19f5ffe.png

Sorry for the delay, here's the correct code:

-	script	maintown	-1,{
OnInit:
	bindatcmd "maintown",strnpcinfo(3)+"::OnAtcommand";
	end;

OnAtcommand:
    if(gettimetick(2) < cooldowntime) {
        dispbottom "Please wait "+(cooldowntime - gettimetick(2))+" seconds.";
    	end;
    }
	atcommand "@warp prontera 158 144";
    set cooldowntime, gettimetick(2) + 5;
	end;
}

image.png.e029abba52199f14141b6c3b75e5d3e6.png

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  63
  • Reputation:   35
  • Joined:  07/04/19
  • Last Seen:  

Untested

-	script	maintown	-1,{
OnInit:
	bindatcmd "maintown",strnpcinfo(3)+"::OnAtcommand";
	end;

OnAtcommand:
        if(gettimetic(2) < cooldowntime) {
              dispbottom "Please wait "+(cooldowntime - gettimetic(2)) / 1000+" seconds.";
              end;
        }
	atcommand "@warp alexandria 158 144";
    set cooldowntime, 5000;
	end;
}

 

Edited by Mastagoon
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

1 minute ago, Mastagoon said:

Untested


-	script	maintown	-1,{
OnInit:
	bindatcmd "maintown",strnpcinfo(3)+"::OnAtcommand";
	end;

OnAtcommand:
        if(gettimetic(2) < cooldowntime) {
              dispbottom "Please wait "+cooldowntime - gettimetic(2) / 1000)+" seconds.";
              end;
        }
	atcommand "@warp alexandria 158 144";
	end;
}

 

got tested i have this error on my console

image.png.b0b1d24ae966c7960b515fc09c61e9b5.png

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  63
  • Reputation:   35
  • Joined:  07/04/19
  • Last Seen:  

7 hours ago, AinsLord said:

got tested i have this error on my console

image.png.b0b1d24ae966c7960b515fc09c61e9b5.png

There is a typo in this code

change gettimetic(2) to gettimetick(2) .

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

On 5/7/2021 at 9:40 AM, Mastagoon said:

There is a typo in this code

change gettimetic(2) to gettimetick(2) .

i tried but i got this error

image.png.9373877ce95121e451e870b3b19f5ffe.png

 

thanks a lot man this would really help ❤️

On 5/7/2021 at 9:06 PM, Mastagoon said:

Sorry for the delay, here's the correct code:

-	script	maintown	-1,{
OnInit:
	bindatcmd "maintown",strnpcinfo(3)+"::OnAtcommand";
	end;

OnAtcommand:
    if(gettimetick(2) < cooldowntime) {
        dispbottom "Please wait "+(cooldowntime - gettimetick(2))+" seconds.";
    	end;
    }
	atcommand "@warp prontera 158 144";
    set cooldowntime, gettimetick(2) + 5;
	end;
}

image.png.e029abba52199f14141b6c3b75e5d3e6.png

 

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