Yoko

All sides of Injection
It is currently 2026-03-10 18:22:08

All times are UTC+02:00




Post new topic  Reply to topic  [ 16 posts ] 
Author Message
 Post subject: Trade Menu with Player
PostPosted: 2004-07-31 09:07:08 
Offline

Joined: 2004-07-20 10:27:42
Posts: 4
Hello, can someone tell me how to (in script :-]) :

- accept the trade with PC player
- take info about his/her offer
- put something to my offer trade menu.

thanks.


Top
   
 Post subject:
PostPosted: 2004-08-05 20:22:00 
Offline

Joined: 2004-07-20 10:27:42
Posts: 4
there isn't anybody who knows how to make this? :-(


Top
   
 Post subject:
PostPosted: 2004-08-06 00:20:09 
Offline
Site Admin
User avatar

Joined: 2004-04-03 16:49:38
Posts: 1964
yes in last published version was added Trade support. alas forum where this was declared died, and i have no time recover "Updates" topic widely.

In short, here are functions:
TradeCount - number of opened windows
TradeContainer(n,["right"]) - serial of trade box
TradeOpponent(n) - serial of trade opponent
TradeName(n) - caption of trade window
TradeCheck(n,["right"]/[newvalue]) - get/set value of trade checkbox

functions was very lightly tested by me, so experiment yourself


Top
   
 Post subject:
PostPosted: 2004-08-06 00:50:56 
Offline

Joined: 2004-07-20 10:27:42
Posts: 4
Cool. Thxs Yoko :-)

and one more little question. If I need info about items in TradeMenu what function i must use?

example: Player John wants to sale some Hides... He put hides on me and the script detect count of hides and put some gold on my part of trade menu.

Thxs a lot.


Top
   
 Post subject:
PostPosted: 2004-08-06 13:53:11 
Offline
Site Admin
User avatar

Joined: 2004-04-03 16:49:38
Posts: 1964
the trade window you see is a 2 containers and 2 checkboxes

serial of container you may get by function above


Top
   
 Post subject:
PostPosted: 2004-08-19 19:21:14 
Offline

Joined: 2004-08-13 00:00:02
Posts: 14
I dont think what is bad in this code:

(transfer data from backpack ("finditem") into left trade container)

Code:
var tcl = UO.TradeContainer("left") # true
UO.MoveItem("finditem","-1",tcl) # bad


Finditem is always taken from backpack and returns into it...


Top
   
 Post subject:
PostPosted: 2004-08-25 18:35:26 
Offline

Joined: 2004-06-29 15:18:30
Posts: 9
Dmitrij wrote:
Finditem is always taken from backpack and returns into it...

Yop, I have the same trouble.

I think it is a bug and right now it is impossible to move anything into the trade box.

Imho only way how to script trading with other players is to initiate every transaction from my side:
I can open trade window when I move an item directly on any character:

Code:
uo.moveitem (anyitem, "-1", SerialOfAnybody)


But this is impossible if any trade window is already opened.

***

Another problem is that if any trade window is canceled the trade containers still remember all offered items. Therefor if a new trade window is opened the uo.findtype() command returns more items than the trade boxes actually contains.
But this problem is not so serious as the first one, because it may be quite fixed with using of uo.forget() command.



I know my English is horrible. I am so sorry :oops:


Top
   
 Post subject:
PostPosted: 2004-08-25 21:27:49 
Offline
Site Admin
User avatar

Joined: 2004-04-03 16:49:38
Posts: 1964
it is much possible that bugs in trading exists cause it was not properly tested and debugged, because of freezed injection developement


Top
   
 Post subject:
PostPosted: 2004-08-26 19:31:30 
Offline

Joined: 2004-06-29 15:18:30
Posts: 9
:| :( :cry: but anyway...
Thank you for everything you made until today...


Top
   
 Post subject:
PostPosted: 2004-08-26 21:30:30 
Offline
Site Admin
User avatar

Joined: 2004-04-03 16:49:38
Posts: 1964
thank you. anyway if you find out bugs in injection's command use Request section to notify me. try to explain problem widely so i can repeat your doings and get same result.


Top
   
 Post subject:
PostPosted: 2004-08-27 19:20:33 
Offline

Joined: 2004-06-29 15:18:30
Posts: 9
Well, I'll try better describe my main problem only to report you potentional bug.
I don't want to create new topic in the request section, because my post has better context here. If you want move it yourself.

As Dmitrij wrote - what is bad on this code?

Dmitrij wrote:
Code:
var tcl = UO.TradeContainer("left") # true
UO.MoveItem("finditem","-1",tcl) # bad





I'm sure that trade window was opened (also uo.TradeCount returned 1) and I'm sure that command uo.TradeContainer() correctly returned serial of my (left side) trade box in the trade window. But "finditem" was not moved to the trade box, but to my backpack.

I also tried this...

Code:
var cnt= uo.TradeContainer()
uo.SetReceivingContainer(cnt) # Prints serial of my trade box on the screen
uo.grab()


...but with the same result. Everything ends in my backpack.


Then I tried to change the container and created this script, which grabs items to my bank box.

Code:
sub test()
var banktype ="0x0e40"
uo.serverprint("bank")
wait(1000)
uo.ignorereset()
uo.findtype (banktype, "-1", "self")
if uo.findcount() > 0 then
  uo.SetReceivingContainer (uo.getserial("finditem"))
  uo.print("Bank was found")
else
  uo.print("Bank is too far")
end if
uo.grab()
end sub()


It works perfectly. Targeted item was moved to my bank box.

So, this is result of my experiments:
There is some problem with trade box container, which is never reachable and so I cannot move anything to it.

I use uo client v. 2.0.0b, Injection v. 0.3.30.4 alpha and I play on POL shard.

Uf, it's all I hope. Is this report you wished?


Top
   
 Post subject:
PostPosted: 2004-08-27 20:51:55 
Offline
Site Admin
User avatar

Joined: 2004-04-03 16:49:38
Posts: 1964
bank box have no any relation to trade containers


Top
   
 Post subject:
PostPosted: 2004-08-27 21:03:42 
Offline
Site Admin
User avatar

Joined: 2004-04-03 16:49:38
Posts: 1964
you both use wrong syntax for trade commands. see PROPERLY what had i written above.


Top
   
 Post subject:
PostPosted: 2004-08-27 21:41:58 
Offline
Site Admin
User avatar

Joined: 2004-04-03 16:49:38
Posts: 1964
i will repeat for clearence

int uo.TradeCount() - number of opened windows
str TradeContainer(n,["right"]) - serial of trade box,by default left box of n-th opened trade window
str TradeOpponent(n) - serial of n-th trade opponent
str TradeName(n) - caption of n-th trade window
int TradeCheck(n,["right"][,newvalue]) - get/set value of trade checkbox
example: uo.tradecheck(0,"left",1)

the n experimentally may start from 1 or 0, easy to check yourself


Top
   
 Post subject:
PostPosted: 2004-08-28 20:01:02 
Offline

Joined: 2004-06-29 15:18:30
Posts: 9
yop, my code may be was not proper, but it should work.

Only one trade box may be opened at the same time on my shard. So n-th opened trade window as default should be ok.
Also uo.tradecount() returned 1 and finally I CHECKED serial, which was returned by uo.TradeContainer(). It was the same as container of item, which I manually moved to my trade box (I used ,info command).

I used bank box only to examine if I can at all move something to any container, especially to such one, which is not bound to any physical item in the game.


Top
   
 Post subject:
PostPosted: 2004-08-28 20:03:28 
Offline

Joined: 2004-06-29 15:18:30
Posts: 9
Now I have found another bug :(
There is really no n parameter in uo.TradeContainer().
Try this:
One trade window was opened.

Code:
uo.SetReceivingContainer(uo.TradeContainer(1,"left")) #Correct serial of the left trade box was printed on the screen

Code:
uo.SetReceivingContainer(uo.TradeContainer(2,"left")) #Returns serial of the left trade box. Same result with any number as n-parameter

Code:
uo.SetReceivingContainer(uo.TradeContainer(1,"right"))#Returns serial of the LEFT!!! trade box.

Code:
uo.SetReceivingContainer(uo.TradeContainer("right"))  #Returns serial of the RIGHT trade box.


I really tested it - trust me and don't be angry on me. I only notify you results of my experiments.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 16 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited