Jump to content
  • 0

R>Script that makes commands


Haze

Question


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   0
  • Joined:  11/02/13
  • Last Seen:  

are there scripts that can be made for commands instead of editing the source?

commands like @afk, @whosell, @itemrain, & @order

if so, could i request for it?

 

@afk - afk a persons account when logout

@whosell - finds a vendor that sells a specific item

         ex. @whosell 607 - find a shop selling Ygg Berry (607)

@itemrain - drops items on the screen visibile to the person using the command

         ex. @itemrain 607 - rains ygg berries on the map visible on the person who types the command

@order <message>- broadcasts a message only the guild sees, only the guild leader can use this command

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

@afk - afk a persons account when logout

@whosell - finds a vendor that sells a specific item

         ex. @whosell 607 - find a shop selling Ygg Berry (607)

these 2 definitely needs source coding

@itemrain - drops items on the screen visibile to the person using the command

         ex. @itemrain 607 - rains ygg berries on the map visible on the person who types the command

-	script	Haze	100,{
Onitemrain:
	.@itemid = atoi( .@atcmd_parameters$ );
	if ( getitemname( .@itemid ) == "null" ) {
		message strcharinfo(0), "Invalid Item ID";
		end;
	}
	.@area = getbattleflag("area_size");
	getmapxy .@map$, .@x, .@y, 0;
	while ( .@i < 100 ) {
		makeitem .@itemid, 1, .@map$, .@x + rand( -.@area, .@area ), .@y + rand( -.@area, .@area );
		.@i++;
	}
	end;
OnInit:
	bindatcmd "itemrain", strnpcinfo(0) +"::Onitemrain", 60,100;
	end;
}

@order <message>- broadcasts a message only the guild sees, only the guild leader can use this command

-	script	Haze	100,{
Onorder:
	if ( !getcharid(2) ) end;
	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) {
		message strcharinfo(0), "Only guild master can use this command";
		end;
	}
	.msg$ = .@atcmd_parameters$;
	addrid 3, 0, getcharid(2);
	announce .msg$, bc_self;
	end;
OnInit:
	bindatcmd "order", strnpcinfo(0) +"::Onorder", 0,100;
	end;
}
  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  


*bindatcmd "<command>","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>};

This command will bind a NPC event label to an atcommand. Upon execution of the

atcommand, the user will invoke the NPC event label. Each atcommand is only allowed

one binding. If you rebind, it will override the original binding.

The following variables are set upon execution:

    .@atcmd_command$ = The name of the @command used.

    .@atcmd_parameters$[] = Array containing the given parameters, starting from an index of 0.

    .@atcmd_numparameters = The number of parameters defined.

Example:

When a user types the command "@test", an angel effect will be shown.

-    script    atcmd_example    -1,{

OnInit:

    bindatcmd "test",strnpcinfo(3)+"::OnAtcommand";

    end;

OnAtcommand:

    specialeffect2 338;

    end;

}

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   0
  • Joined:  11/02/13
  • Last Seen:  

But i dont have the commands defined yet. i was wondering if i could define them via script?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

You can define/override a command by using bindatcmd. However based on your request. I doubt if they can be achieved by a mere script :P

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  151
  • Topics Per Day:  0.04
  • Content Count:  393
  • Reputation:   3
  • Joined:  09/16/13
  • Last Seen:  

Posted · Hidden by Patskie, December 8, 2013 - Some sort of advertisement in my opinion
Hidden by Patskie, December 8, 2013 - Some sort of advertisement in my opinion

hercules have that all commands

Link to comment

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   0
  • Joined:  11/02/13
  • Last Seen:  

 

@afk - afk a persons account when logout

@whosell - finds a vendor that sells a specific item

         ex. @whosell 607 - find a shop selling Ygg Berry (607)

these 2 definitely needs source coding

@itemrain - drops items on the screen visibile to the person using the command

         ex. @itemrain 607 - rains ygg berries on the map visible on the person who types the command

-	script	Haze	100,{
Onitemrain:
	.@itemid = atoi( .@atcmd_parameters$ );
	if ( getitemname( .@itemid ) == "null" ) {
		message strcharinfo(0), "Invalid Item ID";
		end;
	}
	.@area = getbattleflag("area_size");
	getmapxy .@map$, .@x, .@y, 0;
	while ( .@i < 100 ) {
		makeitem .@itemid, 1, .@map$, .@x + rand( -.@area, .@area ), .@y + rand( -.@area, .@area );
		.@i++;
	}
	end;
OnInit:
	bindatcmd "itemrain", strnpcinfo(0) +"::Onitemrain", 60,100;
	end;
}

@order <message>- broadcasts a message only the guild sees, only the guild leader can use this command

-	script	Haze	100,{
Onorder:
	if ( !getcharid(2) ) end;
	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) {
		message strcharinfo(0), "Only guild master can use this command";
		end;
	}
	.msg$ = .@atcmd_parameters$;
	addrid 3, 0, getcharid(2);
	announce .msg$, bc_self;
	end;
OnInit:
	bindatcmd "order", strnpcinfo(0) +"::Onorder", 0,100;
	end;
}

 

Thank you so much for this :D

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