Jump to content
  • 0

Requesting Auction!


Erba

Question


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

Can someone make a script that when a player wants to vend something.. he will post it in an NPC then the item that the player wishes to be in auction will be deleted and be shown in the NPC.. then if someone wants to bid they will also post their bid item in that item and the bid item will be deleted to the player but will only get back the item if they cancel their bids or their trades..

then the seller will have to choose what offer to accept.. after the seller had chosen the player will get the item that the bidder had posted then the bidder will only get the item he bids for after he checked the npc

thanks!!

Link to comment
Share on other sites

14 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:  

this is support section

you need 2 sql table for this

1 table is for auctioning

another table is the ID of the auction for the bidder's item

when player auction something, the auction table automatically generated, which is easy to do

the when players wants to buy a bid item, create another row for the 2nd table according to the ID of the auction

you need my getitemname2 function, how to write dynamic menu with getinventorylist, dynamic menu with sql table,

and more importantly, sendmail script command ... lol

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

trunk\npc\other\auction.txt

/?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

nope.. it is only for zeny mam

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

Oh so you want to trade an item for another item?

Oh so you want to trade an item for another item?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

this is support section

you need 2 sql table for this

1 table is for auctioning

another table is the ID of the auction for the bidder's item

when player auction something, the auction table automatically generated, which is easy to do

the when players wants to buy a bid item, create another row for the 2nd table according to the ID of the auction

you need my getitemname2 function, how to write dynamic menu with getinventorylist, dynamic menu with sql table,

and more importantly, sendmail script command ... lol

Honestly i dont know how to do this XD

Can i request for this script mam AnnieRuru?XD

bump

Link to comment
Share on other sites


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

/*
create table auction_item (
auction_id int(11) primary key auto_increment,
seller_id int(11),
seller_name varchar(23),
time datetime,
nameid smallint(6),
amount smallint(6),
identify enum('0','1'),
refine tinyint(3),
attribute enum('0','1'),
card0 smallint(6),
card1 smallint(6),
card2 smallint(6),
card3 smallint(6)
) engine = innodb;
drop table auction_item;

create table auction_bidder (
id int(11) primary key auto_increment,
auction_id int(11),
buyer_id int(11),
buyer_name varchar(23),
time datetime,
nameid smallint(6),
amount smallint(6),
identify enum('0','1'),
refine tinyint(3),
attribute enum('0','1'),
card0 smallint(6),
card1 smallint(6),
card2 smallint(6),
card3 smallint(6)
) engine = innodb;
drop table auction_bidder;
*/

prontera,155,186,5	script	kjsdhfksh	100,{
mes "aaa";
next;
if ( select( "list", "sell" ) == 1 ) {
	.@nb = query_sql( "select * from auction_item limit 128", .@id, .@cid, .@name$, .@time$, .@itemid, .@amount, .@identify, .@refine, .@attribute, .@card1, .@card2, .@card3, .@card4 );
	for ( .@i = 0; .@i < .@nb; .@i++ )
		mes .@time$[.@i] +" -> "+ .@amount[.@i] +"x "+ callfunc( "getitemname2", .@itemid[.@i], .@identify[.@i], .@refine[.@i], .@attribute[.@i], .@card1[.@i], .@card2[.@i], .@card3[.@i], .@card4[.@i] );
	close;
}
close2;
callshop "auction_item", 2;
end;
OnSellItem:
query_sql "insert into auction_item values ( null, "+ getcharid(0) +", '"+ escape_sql( strcharinfo(0) ) +"', now(), "+ @sold_nameid +", "+ @sold_quantity +", "+ @sold_identify +", "+ @sold_refine +", "+ @sold_attribute +", "+ @sold_card1 +", "+ @sold_card2 +", "+ @sold_card3 +", "+ @sold_card4 +" )";
delitem2 @sold_nameid, @sold_quantity, @sold_identify, @sold_refine, @sold_attribute, @sold_card1, @sold_card2, @sold_card3, @sold_card4;
end;
OnInit:
npcshopattach "auction_item";
end;
}
-	shop	auction_item	-1,501:-1

I'm writing this script 1/2 way and suddenly realize I've made a half-ass work before already

http://www.eathena.ws/board/index.php?s=&showtopic=273365&view=findpost&p=1498394

@emistry, 2 years ago you not able to write, how about today ?

if you not able to write that ctf script, I can take over

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

/*
create table auction_item (
auction_id int(11) primary key auto_increment,
seller_id int(11),
seller_name varchar(23),
time datetime,
nameid smallint(6),
amount smallint(6),
identify enum('0','1'),
refine tinyint(3),
attribute enum('0','1'),
card0 smallint(6),
card1 smallint(6),
card2 smallint(6),
card3 smallint(6)
) engine = innodb;
drop table auction_item;

create table auction_bidder (
id int(11) primary key auto_increment,
auction_id int(11),
buyer_id int(11),
buyer_name varchar(23),
time datetime,
nameid smallint(6),
amount smallint(6),
identify enum('0','1'),
refine tinyint(3),
attribute enum('0','1'),
card0 smallint(6),
card1 smallint(6),
card2 smallint(6),
card3 smallint(6)
) engine = innodb;
drop table auction_bidder;
*/

prontera,155,186,5	script	kjsdhfksh	100,{
mes "aaa";
next;
if ( select( "list", "sell" ) == 1 ) {
	.@nb = query_sql( "select * from auction_item limit 128", .@id, .@cid, .@name$, .@time$, .@itemid, .@amount, .@identify, .@refine, .@attribute, .@card1, .@card2, .@card3, .@card4 );
	for ( .@i = 0; .@i < .@nb; .@i++ )
		mes .@time$[.@i] +" -> "+ .@amount[.@i] +"x "+ callfunc( "getitemname2", .@itemid[.@i], .@identify[.@i], .@refine[.@i], .@attribute[.@i], .@card1[.@i], .@card2[.@i], .@card3[.@i], .@card4[.@i] );
	close;
}
close2;
callshop "auction_item", 2;
end;
OnSellItem:
query_sql "insert into auction_item values ( null, "+ getcharid(0) +", '"+ escape_sql( strcharinfo(0) ) +"', now(), "+ @sold_nameid +", "+ @sold_quantity +", "+ @sold_identify +", "+ @sold_refine +", "+ @sold_attribute +", "+ @sold_card1 +", "+ @sold_card2 +", "+ @sold_card3 +", "+ @sold_card4 +" )";
delitem2 @sold_nameid, @sold_quantity, @sold_identify, @sold_refine, @sold_attribute, @sold_card1, @sold_card2, @sold_card3, @sold_card4;
end;
OnInit:
npcshopattach "auction_item";
end;
}
-	shop	auction_item	-1,501:-1

I'm writing this script 1/2 way and suddenly realize I've made a half-ass work before already

http://www.eathena.w...dpost&p=1498394

@emistry, 2 years ago you not able to write, how about today ?

if you not able to write that ctf script, I can take over

thanks mam!!!!

/kis

ill gonna test it later.. and ill post for the update!! XD

: DB error - Data truncated for column 'identify' at row 1

[Debug]: at ..\src\map\script.c:14407 - insert into auction_item values ( null,150025, 'Perfection', now(), 25149, 1, 0, 0, 0, 0, 0, 0, 0 )

[Debug]: Source (NPC): kjsdhfksh at prontera (155,186)

[Error]: script:delitem2: failed to delete 1 items (AID=2000000 item_id=25149).

[Debug]: Source (NPC): kjsdhfksh at prontera (155,186)

[color=#880000]create table auction_item (

auction_id int(11) primary key auto_increment,

seller_id int(11),

seller_name varchar(23),

time datetime,

nameid smallint(6),

amount smallint(6),

identify enum('0','1'),

refine tinyint(3),

attribute enum('0','1'),

card0 smallint(6),

card1 smallint(6),

card2 smallint(6),

card3 smallint(6)

) engine = innodb;

drop table auction_item;

create table auction_bidder (

id int(11) primary key auto_increment,

auction_id int(11),

buyer_id int(11),

buyer_name varchar(23),

time datetime,

nameid smallint(6),

amount smallint(6),

identify enum('0','1'),

refine tinyint(3),

attribute enum('0','1'),

card0 smallint(6),

card1 smallint(6),

card2 smallint(6),

card3 smallint(6)

) engine = innodb;

drop table auction_bidder;[/color]

i remove the drop table in the end

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

error.......

/*
create table auction_item (
auction_id int(11) primary key auto_increment,
seller_id int(11),
seller_name varchar(23),
time datetime,
nameid smallint(6),
amount smallint(6),
identify enum('0','1'),
refine tinyint(3),
attribute enum('0','1'),
card0 smallint(6),
card1 smallint(6),
card2 smallint(6),
card3 smallint(6)
) engine = innodb;
drop table auction_item;

create table auction_bidder (
id int(11) primary key auto_increment,
auction_id int(11),
buyer_id int(11),
buyer_name varchar(23),
time datetime,
nameid smallint(6),
amount smallint(6),
identify enum('0','1'),
refine tinyint(3),
attribute enum('0','1'),
card0 smallint(6),
card1 smallint(6),
card2 smallint(6),
card3 smallint(6)
) engine = innodb;
drop table auction_bidder;
*/

prontera,155,186,5	script	kjsdhfksh	100,{
mes "aaa";
next;
if ( select( "list", "sell" ) == 1 ) {
	.@nb = query_sql( "select * from auction_item limit 128", .@id, .@cid, .@name$, .@time$, .@itemid, .@amount, .@identify, .@refine, .@attribute, .@card1, .@card2, .@card3, .@card4 );
	for ( .@i = 0; .@i < .@nb; .@i++ )
		mes .@time$[.@i] +" -> "+ .@amount[.@i] +"x "+ callfunc( "getitemname2", .@itemid[.@i], .@identify[.@i], .@refine[.@i], .@attribute[.@i], .@card1[.@i], .@card2[.@i], .@card3[.@i], .@card4[.@i] );
	close;
}
close2;
callshop "auction_item", 2;
end;
OnSellItem:
query_sql "insert into auction_item values ( null, "+ getcharid(0) +", '"+ escape_sql( strcharinfo(0) ) +"', now(), "+ @sold_nameid +", "+ @sold_quantity +", "+ @sold_identify +", "+ @sold_refine +", "+ @sold_attribute +", "+ @sold_card1 +", "+ @sold_card2 +", "+ @sold_card3 +", "+ @sold_card4 +" )";
delitem2 @sold_nameid, @sold_quantity, @sold_identify, @sold_refine, @sold_attribute, @sold_card1, @sold_card2, @sold_card3, @sold_card4;
end;
OnInit:
npcshopattach "auction_item";
end;
}
-	shop	auction_item	-1,501:-1

I'm writing this script 1/2 way and suddenly realize I've made a half-ass work before already

http://www.eathena.w...dpost&p=1498394

@emistry, 2 years ago you not able to write, how about today ?

if you not able to write that ctf script, I can take over

BUMP................

post-3034-0-41988700-1360170999_thumb.jpg

Edited by caspa
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

bump

 

bump

 

@bump

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


/*

create table auction_item (

auction_id int(11) primary key auto_increment,

seller_id int(11),

seller_name varchar(23),

time datetime,

nameid smallint(6),

amount smallint(6),

identify tinyint(1),

refine tinyint(3),

attribute tinyint(1),

card0 smallint(6),

card1 smallint(6),

card2 smallint(6),

card3 smallint(6)

) engine = innodb;

drop table auction_item;

create table auction_bidder (

id int(11) primary key auto_increment,

auction_id int(11),

buyer_id int(11),

buyer_name varchar(23),

time datetime,

nameid smallint(6),

amount smallint(6),

identify tinyint(1),

refine tinyint(3),

attribute tinyint(1),

card0 smallint(6),

card1 smallint(6),

card2 smallint(6),

card3 smallint(6)

) engine = innodb;

drop table auction_bidder;

*/

prontera,155,186,5 script kjsdhfksh 100,{

mes "aaa";

next;

if ( select( "list", "sell" ) == 1 ) {

.@nb = query_sql( "select * from auction_item limit 128", .@id, .@cid, .@name$, .@time$, .@itemid, .@amount, .@identify, .@refine, .@attribute, .@card1, .@card2, .@card3, .@card4 );

for ( .@i = 0; .@i < .@nb; .@i++ )

mes .@time$[.@i] +" -> "+ .@amount[.@i] +"x "+ callfunc( "getitemname2", .@itemid[.@i], .@identify[.@i], .@refine[.@i], .@attribute[.@i], .@card1[.@i], .@card2[.@i], .@card3[.@i], .@card4[.@i] );

close;

}

close2;

callshop "auction_item", 2;

end;

OnSellItem:

for ( .@i = 0; .@i < getarraysize( @sold_nameid ); .@i++ ) {

query_sql "insert into auction_item values ( null, "+ getcharid(0) +", '"+ escape_sql( strcharinfo(0) ) +"', now(), "+ @sold_nameid[.@i] +", "+ @sold_quantity[.@i] +", "+ @sold_identify[.@i] +", "+ @sold_refine[.@i] +", "+ @sold_attribute[.@i] +", "+ @sold_card1[.@i] +", "+ @sold_card2[.@i] +", "+ @sold_card3[.@i] +", "+ @sold_card4[.@i] +" )";

if( getiteminfo( @sold_nameid[.@i],2 ) == 4 || getiteminfo( @sold_nameid[.@i],2 ) == 5 )

delitem2 @sold_nameid[.@i], @sold_quantity[.@i], @sold_identify[.@i], @sold_refine[.@i], @sold_attribute[.@i], @sold_card1[.@i], @sold_card2[.@i], @sold_card3[.@i], @sold_card4[.@i];

else

delitem @sold_nameid[.@i], @sold_quantity[.@i];

}

end;

OnInit:

npcshopattach "auction_item";

end;

}

- shop auction_item -1,501:-1

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   1
  • Joined:  11/14/11
  • Last Seen:  

Hello,

Thx for this script, but look like not work:

 

    parse_line: expect command, missing function name or calling undeclared function

 

    43 : 	mes "aaa";
    44 : 	next;
    45 : 	if ( select( "list", "sell" ) == 1 ) {
*   46 : 		'.'@nb = query_sql( "select * from auction_item limit 128", .@id, .@cid, .@name$, .@time$, .@itemid, .@amount, .@identify, .@refine, .@attribute, .@card1, .@card2, .@card3, .@card4 );
    47 : 		for ( .@i = 0; .@i < .@nb; .@i++ )
    48 : 			mes .@time$[.@i] +" -> "+ .@amount[.@i] +"x "+ callfunc( "getitemname2", .@itemid[.@i], .@identify[.@i], .@refine[.@i], .@attribute[.@i], .@card1[.@i], .@card2[.@i], .@card3[.@i], .@card4[.@i] );
    49 : 		close;
    50 : 	}
    51 : 	close2;

 

I don't know why my auction system not work, and this script not work :/

Can you help me ?

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

You don't use rathena.

Try this one :


/*
create table auction_item (
auction_id int(11) primary key auto_increment,
seller_id int(11),
seller_name varchar(23),
time datetime,
nameid smallint(6),
amount smallint(6),
identify tinyint(1),
refine tinyint(3),
attribute tinyint(1),
card0 smallint(6),
card1 smallint(6),
card2 smallint(6),
card3 smallint(6)
) engine = innodb;
drop table auction_item;

create table auction_bidder (
id int(11) primary key auto_increment,
auction_id int(11),
buyer_id int(11),
buyer_name varchar(23),
time datetime,
nameid smallint(6),
amount smallint(6),
identify tinyint(1),
refine tinyint(3),
attribute tinyint(1),
card0 smallint(6),
card1 smallint(6),
card2 smallint(6),
card3 smallint(6)
) engine = innodb;
drop table auction_bidder;
*/

prontera,155,186,5	script	kjsdhfksh	100,{
	mes "aaa";
	next;
	if ( select( "list", "sell" ) == 1 ) {
		set .@nb, query_sql( "select * from auction_item limit 128", .@id, .@cid, .@name$, .@time$, .@itemid, .@amount, .@identify, .@refine, .@attribute, .@card1, .@card2, .@card3, .@card4 );
		for ( set .@i, 0; .@i < .@nb; set .@i, .@i +1 )
			mes .@time$[.@i] +" -> "+ .@amount[.@i] +"x "+ callfunc( "getitemname2", .@itemid[.@i], .@identify[.@i], .@refine[.@i], .@attribute[.@i], .@card1[.@i], .@card2[.@i], .@card3[.@i], .@card4[.@i] );
		close;
	}
	close2;
	callshop "auction_item", 2;
	end;
OnSellItem:
	for ( set .@i, 0; .@i < getarraysize( @sold_nameid ); set .@i, .@i +1 ) {
		query_sql "insert into auction_item values ( null, "+ getcharid(0) +", '"+ escape_sql( strcharinfo(0) ) +"', now(), "+ @sold_nameid[.@i] +", "+ @sold_quantity[.@i] +", "+ @sold_identify[.@i] +", "+ @sold_refine[.@i] +", "+ @sold_attribute[.@i] +", "+ @sold_card1[.@i] +", "+ @sold_card2[.@i] +", "+ @sold_card3[.@i] +", "+ @sold_card4[.@i] +" )";
		if( getiteminfo( @sold_nameid[.@i],2 ) == 4 || getiteminfo( @sold_nameid[.@i],2 ) == 5 )
			delitem2 @sold_nameid[.@i], @sold_quantity[.@i], @sold_identify[.@i], @sold_refine[.@i], @sold_attribute[.@i], @sold_card1[.@i], @sold_card2[.@i], @sold_card3[.@i], @sold_card4[.@i];
		else
			delitem @sold_nameid[.@i], @sold_quantity[.@i];
	}
	end;
OnInit:
	npcshopattach "auction_item";
	end;
}
-	shop	auction_item	-1,501:-1

EDIT: Forgot a coma

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   1
  • Joined:  11/14/11
  • Last Seen:  

Hello,

Thx for your answer, i use a old Rathena version 15869.

Some error:

 

 

(04/22/2013 16:37:17) [ Warning ] : npc_scriptcont: failed npc_checknear test.
(04/22/2013 16:37:17) [ Warning ] : npc_scriptcont: failed npc_checknear test.
(04/22/2013 16:41:13) [ Error ] : script:callfunc: function not found! [getitemname2]
 
is auction work fine now with Rathena ?
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

(04/22/2013 16:41:13) [ Error ] : script:callfunc: function not found! [getitemname2]

getitemname2 function is in this topic

 

I don't have the warning when I use this script, maybe it's on another npc ?

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