Jump to content
  • 0

help Cash Trader


GMxR

Question


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  34
  • Reputation:   0
  • Joined:  02/13/12
  • Last Seen:  

hello,

 

this script of mine is working just fine, but i want to shorten it. i'm not so familiar with the complexity of scripting. if someone could help me that would be nice.

thanks.

cash trader3.txt

Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

Since your in support section I'll point you in right direction so you can give it a shot OK,

Look into the following in the script_command.txt

Arrays

While / for

Switch

OnInit: (for config settings)

Getitemname

And... Think that's all you'll need

hello,

this script of mine is working just fine, but i want to shorten it. i'm not so familiar with the complexity of scripting. if someone could help me that would be nice.

thanks.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  34
  • Reputation:   0
  • Joined:  02/13/12
  • Last Seen:  

^_^ i should've posted it on request instead. lolz. but thanks @Stolao. i'll try learning from those commands. (y)

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

Lol to learn anyways

If you still can get it or want further advice after you try then I'll help you more :)

^_^ i should've posted it on request instead. lolz. but thanks @Stolao. i'll try learning from those commands. (y)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  34
  • Reputation:   0
  • Joined:  02/13/12
  • Last Seen:  

yeah i could use some help. ^_^ if i could only see a sample of something i know i can get it shorter. ^_^ it took 3000 lines now /omg

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

Start with 5 or so ids then exspand it once you have it working, btw my ex job master was 9300+ lines now it's 430ish

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Holy ****, that's a long script xD, like Stoloa mentioned try to use those commands.

My longest is Training System with 2890 lines and 102 KB large xD.

If you ever need help, just tell us :).

Regards,

Chris

Note: no offense intended ;)

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  34
  • Reputation:   0
  • Joined:  02/13/12
  • Last Seen:  

thanks,

okay.. i manage to shrink it down somehow, but now i'm lost.i wan't to include the "attainable" cash on the trade-able item preview, and give reward specifically depending on the traded goods. 

 

prontera,144,174,3	script	Cash Trader	630,{	
	.@inventorylist_count = getarraysize( .itemID );
	.@cash_cost = getarraysize( .ccost );
	
	mes .n$;
	mes "What?";
	switch(select("Trade:Nothing")) {
		case 1:
			next;
			//getinventorylist; 
			for(set .@i,0; .@i < .@inventorylist_count; set .@i,.@i+1){
				if( !countitem( .itemID[.@i] ) <1 ){ 
					mes .n$;
					mes "Lemme see.....hmmm..";
					next;
					mes .n$;
					mes "You have an ^ff0000"+getitemname( .itemID[.@i] );
					mes "Are you sure you want to trade all of that?";
					switch(select("Yes Please:Nevermind.")) {
						case 1:
							end;
						case 2:
							next;
							mes .n$;
							mes "Goodbye then.";
						}
					
						
				}
			}
			mes "You don't have a cash trade-able item with you.";
			close;
		case 2:
			end;
		}
		

OnInit:
	set .n$,"[^80a4ffCash Trader^000000]";
	setarray .itemID[0],
		4357,4359,4361,4363,4367,4365,4407,4318,4403,4441,4128,4342,4372,4134,4352,4430,4374,
		4376,4408,4145,4324,4386,4330,4236,4302,31000,31001,4241,4277,4174,4284,4054,4183,4306,
		4198,4047,20163,4336,4250,4254,4207,4203,4197,4300,4179,4266,1415,1233,1365,1528,1228,
		2343,2421,1468,7513,1420,1524,13017,2700,1722,1130,2345,2678,2679,2659,12129,7566,7754,
		7451,7036,7562,7211,7169,7289,7290,7291,7292,7293,7294,7295,7296,7297,7510,7035,4123,
		4146,4131,4132,4305,4121,4135,4143,4142,4144,4276,4137,4147,4168,4148,1284,1745,1311,
		1561,13421,1646,1030,7020,1525,7018,1141,1236,1363,10018,2258,751,7109,5019,750,2507,7113;
		
	setarray .ccost[0],
		850,850,850,850,850,850,750,750,750,750,750,750,750,750,750,750,750,750,750,750,650,650
		,650,650,650,550,550,350,350,350,250,250,250,250,250,250,250,250,150,150,150,150,150,
		150,150,150,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,
		20,20,15,15,15,15,15,15,15,15,15,15,15,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
		10,10,10,10,10,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4;	
	end;

}

also how can i make it so, that it will consume all the trade-able items, and multiply the cash rewards?


EDIT:

~ nevermind. ^_^ i figured it out. thanks.

Edited by GMxR
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

Gj :)

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