Jump to content
  • 0

atcommand in item


Question

Posted

The script will be placed in the item. Closer to this purpose is Megaphone.

I want selected item will make @item for the selected account id.

When the character of the account id click on it will get input box.

The input box will collect the item name or item code and quantity.

So the character will get the item.

9 answers to this question

Recommended Posts

Posted

Just call a function inside the item. Make it an usable item.

{ callfunc "getItem__"; },{},{}

then the function itself..

function    script    getItem__    {

mes "input the ID";
input .@id;

//Code to check if the input is avaible/correct

mes "input the amount";
input .@amount;

//Code to check if the input is avaible/correct

getitem .@id, .@amount;
return;
}

Posted (edited)

Yeah, you can add a timer and setting that kinf of command too, exactly in the same way.

Something like...

function	script	command__	{

attachnpctimer getcharid(3);
atcommand "@autoattack";
initnpctimer;
return;

OnTimer60000: //60 seconds
OnTimerQuit:
atcommand "@autoattack";
   end;
}

Note that you have to be careful to use an @command in the OnTimerQuit label, 'cause the player already logged out but it may be still able to run the command.

Edited by Ryokem
Posted

Yeah, it will delete the item if you set that the item expires after being used.

And I personally try not to use atcommand command inside scripts unless it's really the only choice I have, mostly 'cause of server runtime.

Posted

Thank you. This is really help.

How about with checking account no.

Example, I want it only serve account no. 2000004

other than this account no. the script will be not activated.

Posted

function	script	getItem__	{if( getcharid(3) == 2000004 ){

mes "input the ID";
input .@id;

mes "input the amount";
input .@amount;

getitem .@id, .@amount;
return;
}}

//Code to check if the input is avaible/correct

//Code to check if the input is avaible/correct

Any one please help this fine tuning.

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