Jump to content
  • 0

help - Auto Attack


GM Takumirai

Question


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

- I patch the auto attack by God http://rathena.org/b...297-autoattack/

- i make a custom item

30000,AutoAttack_Box,AutoAttack Box,18,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 30001,604800; },{},{}

- and i make a function


function script command__ {

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

- and i put also

30001,Auto_Attack_Card,Auto Attack,11,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "command__"; },{},{}

- my problem is what if the Auto Attack Card will expired?.. is the function enough to stop from auto attacking??.. if the expiration end?

Edited by GM Takumirai
Link to comment
Share on other sites

12 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  60
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   219
  • Joined:  11/22/11
  • Last Seen:  

press start, press end, no press no change.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

@god

is there a solution to provide in the function of a script to check if the item gone due to expiration the player will force to logout??..

- because it will be abuse if pressing it / using it then the time expire still the player are in auto attack state..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  60
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   219
  • Joined:  11/22/11
  • Last Seen:  

@god

is there a solution to provide in the function of a script to check if the item gone due to expiration the player will force to logout??..

- because it will be abuse if pressing it / using it then the time expire still the player are in auto attack state..

create new event (OnItemGoneEvent:) to supply

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

thanks for the response @God,

create new event (OnItemGoneEvent:) to supply

how to do it?.. sorry im noob ..

and please check the function script if it's right


function script command__ {

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

Edited by GM Takumirai
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   1
  • Joined:  02/20/12
  • Last Seen:  

try this

30001,Auto_Attack_Card,Auto Attack,11,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{},{ callfunc "command__"; set @at,1;},{ callfunc "command__"; set @at,0;}

function script command__ {

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

and

- script fixautoattack {
OnPCLoginEvent:
if (@at == 0)
{end;} else { atcommand "@autoattack"; set @at,0;};
end;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

Thanks Testing this /lv

got error

try this

30001,Auto_Attack_Card,Auto Attack,11,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{},{ callfunc "command__"; set @at,1;},{ callfunc "command__"; set @at,0;}

function script command__ {

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

and

- script fixautoattack {
OnPCLoginEvent:
if (@at == 0)
{end;} else { atcommand "@autoattack"; set @at,0;};
end;


[Error]: npc_parsesrcfile: Unknown syntax in file 'npc/AGNRO/VIP/VIP-auto-attack.txt', line '1'. Stopping...
* w1=function script command__ {
* w2=
* w3=
* w4=
[Error]: npc_parsesrcfile: Unknown syntax in file 'npc/AGNRO/VIP/VIP-auto-attack-checker.txt', line '1'. Stopping...
* w1=- script fixautoattack {
* w2=
* w3=
* w4=

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  44
  • Reputation:   48
  • Joined:  11/19/11
  • Last Seen:  

You're missing the tabs in the function & npc headers.

function<TAB>script<TAB>command__<tab>{
...
-<tab>script<tab>fixautoattack<tab>{
...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

Oh that's why, thanks Toast

it seem that its not working..

// Auto Attack Box to make the card have rental or expire time

29056,Auto_Attack_Box,Auto Attack Box,18,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 29002,604800; },{},{}

29002,autoatk_Card,Auto Attack Card,11,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{},{ callfunc "command__"; set @at,1;},{ callfunc "command__"; set @at,0;}

//This command is tfor the Auto Attack Card to used it


function script command__ {

atcommand "@autoattack";
return;}

//This Code is to check if the item Auto Attack Card Expired the Auto Attack Command will force to cancel


- script fixautoattack -1,{
OnPCLoginEvent:
if (@at == 0)
{end;} else { atcommand "@autoattack"; set @at,0;};
end;}

i dont know what is the problem there's no error in map..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   1
  • Joined:  02/20/12
  • Last Seen:  

- script fixautoattack -1,{
OnPCLoginEvent:
if (@at == 0 && (getequipid(<equipment slot>) == 29002 ))
{end;} else if (@at == 1 && (getequipid(<equipment slot>) == 29002 )) { atcommand "@autoattack"; set @at,0;};
end;}

Try this

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

- script fixautoattack -1,{
OnPCLoginEvent:
if (@at == 0 && (getequipid(<equipment slot>) == 29002 ))
{end;} else if (@at == 1 && (getequipid(<equipment slot>) == 29002 )) { atcommand "@autoattack"; set @at,0;};
end;}

Try this

sir how about if i make the item equipable

example if i equip the item it will trigger command @autoattack..

but if i un-equip the item, @autoattack will trigger off.. but the problem on the patch of God there's no @autoattack on and @autoattack off command, only it trigger @autoattack.. is there any solution?..

and also a checker if the item gone and still in the state of @autoattack, it will automaticaly disable the @autoattack..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   1
  • Joined:  02/20/12
  • Last Seen:  

ITEM BOX:

29056,Auto_Attack_Box,Auto Attack Box,18,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 29002,604800; },{},{}

ITEM AUTO

29002,autoatk_Card,Auto Attack Card,11,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{},{ callfunc "command__"; set @at,1;},{ callfunc "command__"; set @at,0;}

FUNCTION ATCOMMAND

function script command__ {
atcommand "@autoattack";
return;}

FUNCTION CHECK

- script fixautoattack -1,{
OnPCLogoutEvent:
if (@at == 1)
{ atcommand "@autoattack"; set @at,0;};
end;
}

Before TEST plz unequip ITEM AUTO and turn off auto attack.

Sr ! My English is very very very BAD :(

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

No problem i understand it all...

btw its working now ill post if i find some bug, and thanks for the help..

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