Terraria selling script sorta working Topic is solved

Ask gaming related questions (AHK v1.1 and older)
Guest

Terraria selling script sorta working

26 Dec 2014, 17:09

Hey people, first of all, Merry Christmas.
I created a script to sell items in my inventory by Holding shift key and left click on items to sell, sometimes it's working flawless and sometimes it just left click (holds the item instead selling it) and sells all the rest without a problem. For beter understand (sorry for my bad english also) see limk for the picture

http://nl.tinypic.com/view.php?pic=zxwcva&s=8

the selling way goes from right (1) to left (10). But sometimes it miss to hold shift and Left click on box 1

Code: Select all

Numpad1:: ; First row Inventory
CoordMode, Mouse, Relative
Loop, 1 
{
	MouseGetPos, xpos, ypos ; The cursor is at X%xpos% Y%ypos%.
Send, {Shift Down}
Click, 479, 264, left, Down
Sleep, 50
Click, 479, 264, left, Up
Send, {shift Up}

Sleep, 50

Send, {Shift Down}
Click, 430, 264, left, Down
Sleep, 50
Click, 430, 264, left, Up
Send, {shift Up}

Sleep, 50

Send, {Shift Down}
Click, 383, 264, left, Down
Sleep, 50
Click, 383, 264, left, Up
Send, {shift Up}

Sleep, 50

Send, {Shift Down}
Click, 334, 264, left, Down
Sleep, 50
Click, 334, 264, left, Up
Send, {Shift Up}

Sleep, 50

Send, {Shift Down}
Click, 290, 264, left, Down
Sleep, 50
Click, 290, 264, left, Up
Send, {Shift Up}

Sleep, 50

Send, {Shift Down}
Click, 240, 264, left, Down
Sleep, 50
Click, 240, 264, left, Up
Send, {Shift Up}

Sleep, 50

Send, {Shift Down}
Click, 193, 264, left, Down
Sleep, 50
Click, 193, 264, left, Up
Send, {Shift Up}

Sleep, 50

Send, {Shift Down}
Click, 145, 264, left, Down
Sleep, 50
Click, 145, 264, left, Up
Send, {Shift Up}

Sleep, 50

Send, {Shift Down}
Click, 98, 264, left, Down
Sleep, 50
Click, 98, 264, left, Up
Send, {Shift Up}

Sleep, 50

Send, {Shift Down}
Click, 50, 264, left, Down
Sleep, 50
Click, 50, 264, left, Up
Send, {Shift Up}
	
MouseMove, %xpos%, %ypos% ; move the cursor back
}
return
I also created for the second and the third row, but it seems the first and the second row got's the problem fromt time to time and the third row never had that problem...

Anyone can help me what i should do? i tried mousemove, also sendevent etc etc
floowsnaake
Posts: 7
Joined: 02 Sep 2014, 11:05

Re: Terraria selling script sorta working  Topic is solved

27 Dec 2014, 08:02

Hi, try this

Code: Select all

#SingleInstance, Force
CoordMode, Mouse, Relative

Numpad1:: ; First row of the Inventory.
{
MouseGetPos, xpos, ypos ; The cursor is at X%xpos% Y%ypos%.
Box("479","264")
Box("430","264")
Box("383","264")
Box("334","264")
Box("290","264")
Box("240","264")
Box("193","264")
Box("145","264")
Box("264","264")
Box("50","264")
MouseMove, %xpos%, %ypos% ; Moves the cursor back to its original posistion.
}
return

Box(xx,yy){
Send, {Shift Down}
Click, %xx%, %yy%,left, Down
Sleep, 200
Click, %xx%, %yy%,left, Up
Send, {shift Up}
Sleep, 200
}
Guest

Re: Terraria selling script sorta working

28 Dec 2014, 11:41

floowsnaake wrote:Hi, try this

Code: Select all

#SingleInstance, Force
CoordMode, Mouse, Relative

Numpad1:: ; First row of the Inventory.
{
MouseGetPos, xpos, ypos ; The cursor is at X%xpos% Y%ypos%.
Box("479","264")
Box("430","264")
Box("383","264")
Box("334","264")
Box("290","264")
Box("240","264")
Box("193","264")
Box("145","264")
Box("264","264")
Box("50","264")
MouseMove, %xpos%, %ypos% ; Moves the cursor back to its original posistion.
}
return

Box(xx,yy){
Send, {Shift Down}
Click, %xx%, %yy%,left, Down
Sleep, 200
Click, %xx%, %yy%,left, Up
Send, {shift Up}
Sleep, 200
}
Hey buddy, thanks for your reply, it's much cleaner then my code, but if i less then sleep, 100, it often miss to sell the first space but overall, it's cleaner!
Btw, you also have Terraria?
floowsnaake
Posts: 7
Joined: 02 Sep 2014, 11:05

Re: Terraria selling script sorta working

28 Dec 2014, 12:44

Yes i play it a lot because of all the new updates and patches :3
Guest

Re: Terraria selling script sorta working

28 Dec 2014, 14:26

floowsnaake wrote:Yes i play it a lot because of all the new updates and patches :3
So anyway thanks for the cleaner version of my script, to bad it still for some reason click and hold the first item of the row and sell the other items without a problem till it finishes the job even with sleep, 100. My previous script was more like this

Code: Select all

Numpad1:: ; sell first row items
CoordMode, Mouse, Relative
Loop, 1 
{
	MouseGetPos, xpos, ypos ; The cursor is at X%xpos% Y%ypos%.
Click, 479, 264, left, Down
Sleep, 50
Click, 479, 264, left, Up

Sleep, 50

Click, 479, 433, left, Down
sleep, 50
Click, 479, 433, left, Up

Sleep, 50

Click, 430, 264, left, Down
Sleep, 50
Click, 430, 264, left, Up

sleep, 50

Click, 479, 433, left, Down
sleep, 50
Click, 479, 433, left, Up


Sleep, 50

Click, 383, 264, left, Down
Sleep, 50
Click, 383, 264, left, Up

Sleep, 50

Click, 479, 433, left, Down
sleep, 50
Click, 479, 433, left, Up

Sleep, 50

Click, 334, 264, left, Down
Sleep, 50
Click, 334, 264, left, Up

Sleep, 50

Click, 479, 433, left, Down
sleep, 50
Click, 479, 433, left, Up

Sleep, 50

Click, 290, 264, left, Down
Sleep, 50
Click, 290, 264, left, Up

Sleep, 50

Click, 479, 433, left, Down
sleep, 50
Click, 479, 433, left, Up

Sleep, 50

Click, 240, 264, left, Down
Sleep, 50
Click, 240, 264, left, Up

Sleep, 50

Click, 479, 433, left, Down
sleep, 50
Click, 479, 433, left, Up

Sleep, 50

Click, 193, 264, left, Down
Sleep, 50
Click, 193, 264, left, Up

Sleep, 50

Click, 479, 433, left, Down
sleep, 50
Click, 479, 433, left, Up

Sleep, 50


Click, 145, 264, left, Down
Sleep, 50
Click, 145, 264, left, Up

Sleep, 50

Click, 479, 433, left, Down
sleep, 50
Click, 479, 433, left, Up

Sleep, 50

Click, 98, 264, left, Down
Sleep, 50
Click, 98, 264, left, Up

Sleep, 50

Click, 479, 433, left, Down
sleep, 50
Click, 479, 433, left, Up

Sleep, 50

Click, 50, 264, left, Down
Sleep, 50
Click, 50, 264, left, Up

Sleep, 50
 
Click, 479, 433, left, Down
sleep, 50
Click, 479, 433, left, Up
	
MouseMove, %xpos%, %ypos% ; move the cursor back
}
return
To much stuff for 1 row, it picked up an item and moved it to the sell box and then went to the next item, but then i found out the pish and hold shift button and left click item to sell or to put it in trash box which is easier but yeah don't what else to do i like your code, it's simpler and cleaner then both of my "codes"

Ps: can't wait for patch 1.3. :3
Lebastard
Posts: 49
Joined: 21 Oct 2014, 09:01

Re: Terraria selling script sorta working

28 Dec 2014, 14:32

Ok, found my logins back, so now you know who's asking instead of the Guest. :p
Lebastard
Posts: 49
Joined: 21 Oct 2014, 09:01

Re: Terraria selling script sorta working

28 Dec 2014, 16:58

Lebastard wrote:Ok, found my logins back, so now you know who's asking instead of the Guest. :p
Any other options or suggestion, always welcome.
floowsnaake
Posts: 7
Joined: 02 Sep 2014, 11:05

Re: Terraria selling script sorta working

29 Dec 2014, 17:06

I made some new changes to it

Code: Select all

#SingleInstance, Force
CoordMode, Mouse, Relative
Box = 479
Row = 264

Numpad1::
MouseGetPos,x,y
Loop,10	
{
Send {Shift Down}
Click %Box%,%Row%,left,Down
Sleep 100
Click %Box%,%Row%,left,Up
Send {shift Up}
Box -= 49
}
MouseMove, %x%,%y%
Box = 479
return

Here is a more complexed script, you can also make it all to a function to save a lot of lines in your code but this is just for showing/example

That can empty specific rows/lines in your inventory by pressing Numpad 1 to 5

Code: Select all

#SingleInstance, Force
CoordMode, Mouse, Relative
Box = 479
Row = 264

Numpad1::
MouseGetPos,x,y
Loop,10	
{
Send {Shift Down}
Click %Box%,%Row%,left,Down
Sleep 100
Click %Box%,%Row%,left,Up
Send {shift Up}
Box -= 49
}
MouseMove, %x%,%y%
Box = 479
return

Numpad2::
Row = 215
Box = 479
MouseGetPos,x,y
Loop,10	
{
Send {Shift Down}
Click %Box%,%Row%,left,Down
Sleep 100
Click %Box%,%Row%,left,Up
Send {shift Up}
Box -= 49
}
MouseMove, %x%,%y%
Box = 479
return

Numpad3::
Row = 166
Box = 479
MouseGetPos,x,y
Loop,10	
{
Send {Shift Down}
Click %Box%,%Row%,left,Down
Sleep 100
Click %Box%,%Row%,left,Up
Send {shift Up}
Box -= 49
}
MouseMove, %x%,%y%
Box = 479
return

Numpad4::
Row = 117
Box = 479
MouseGetPos,x,y
Loop,10	
{
Send {Shift Down}
Click %Box%,%Row%,left,Down
Sleep 100
Click %Box%,%Row%,left,Up
Send {shift Up}
Box -= 49
}
MouseMove, %x%,%y%
Box = 479
return

Numpad5::
Row = 68
Box = 479
MouseGetPos,x,y
Loop,10	
{
Send {Shift Down}
Click %Box%,%Row%,left,Down
Sleep 100
Click %Box%,%Row%,left,Up
Send {shift Up}
Box -= 49
}
MouseMove, %x%,%y%
Box = 479
return

Esc::
{
ExitApp	
}
return
Lebastard
Posts: 49
Joined: 21 Oct 2014, 09:01

Re: Terraria selling script sorta working

29 Dec 2014, 19:00

floowsnaake wrote:I made some new changes to it

Code: Select all

#SingleInstance, Force
CoordMode, Mouse, Relative
Box = 479
Row = 264

Numpad1::
MouseGetPos,x,y
Loop,10	
{
Send {Shift Down}
Click %Box%,%Row%,left,Down
Sleep 100
Click %Box%,%Row%,left,Up
Send {shift Up}
Box -= 49
}
MouseMove, %x%,%y%
Box = 479
return

Here is a more complexed script, you can also make it all to a function to save a lot of lines in your code but this is just for showing/example

That can empty specific rows/lines in your inventory by pressing Numpad 1 to 5

Code: Select all

#SingleInstance, Force
CoordMode, Mouse, Relative
Box = 479
Row = 264

Numpad1::
MouseGetPos,x,y
Loop,10	
{
Send {Shift Down}
Click %Box%,%Row%,left,Down
Sleep 100
Click %Box%,%Row%,left,Up
Send {shift Up}
Box -= 49
}
MouseMove, %x%,%y%
Box = 479
return

Numpad2::
Row = 215
Box = 479
MouseGetPos,x,y
Loop,10	
{
Send {Shift Down}
Click %Box%,%Row%,left,Down
Sleep 100
Click %Box%,%Row%,left,Up
Send {shift Up}
Box -= 49
}
MouseMove, %x%,%y%
Box = 479
return

Numpad3::
Row = 166
Box = 479
MouseGetPos,x,y
Loop,10	
{
Send {Shift Down}
Click %Box%,%Row%,left,Down
Sleep 100
Click %Box%,%Row%,left,Up
Send {shift Up}
Box -= 49
}
MouseMove, %x%,%y%
Box = 479
return

Numpad4::
Row = 117
Box = 479
MouseGetPos,x,y
Loop,10	
{
Send {Shift Down}
Click %Box%,%Row%,left,Down
Sleep 100
Click %Box%,%Row%,left,Up
Send {shift Up}
Box -= 49
}
MouseMove, %x%,%y%
Box = 479
return

Numpad5::
Row = 68
Box = 479
MouseGetPos,x,y
Loop,10	
{
Send {Shift Down}
Click %Box%,%Row%,left,Down
Sleep 100
Click %Box%,%Row%,left,Up
Send {shift Up}
Box -= 49
}
MouseMove, %x%,%y%
Box = 479
return

Esc::
{
ExitApp	
}
return
Wow nice, gonna try this out tomorrow morning and let you know asap. You use any scripts in Terraria or you don't play often anymore?
Lebastard
Posts: 49
Joined: 21 Oct 2014, 09:01

Re: Terraria selling script sorta working

30 Dec 2014, 04:49

Hey floowsnaake, i tried both of them they work as it should, yet for some reason it always just click the first item box but sells all other boxes with the item at the arrow.
As you can see it in my vid:
Lebastard
Posts: 49
Joined: 21 Oct 2014, 09:01

Re: Terraria selling script sorta working

18 Jan 2015, 16:50

Anyone else knows i solution i tried something else but same problem with the first box

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: eazsy and 43 guests