Trade Autocancel Warning Script

Discussion about the Pets, Items, Dress-ups, Events, Site, Forum or other CS features!

Re: Trade Autocancel Warning Script

Postby BeanCat » Sat Jan 18, 2025 3:49 pm

I love that this thread is finally being acknowledged, I just wish that it could have been implemented site wide instead of being an extension made by an amazing volunteer. This game reminds me of the sims 4 in many ways strangely 😅 (iykyk). Thanks for your effort! ♥️🙏
Idk what to put here
User avatar
BeanCat
 
Posts: 1237
Joined: Sat Dec 09, 2023 6:51 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Trade Autocancel Warning Script

Postby Seasonal » Sun Jan 19, 2025 5:11 pm

This is really cool! Thanks for making it <3
Image




Enter the CS writing competition
and you could win me!
User avatar
Seasonal
Admin Assistant
 
Posts: 24452
Joined: Wed Sep 24, 2008 7:48 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Trade Autocancel Warning Script

Postby odin » Mon Jan 20, 2025 10:46 pm

Super neat!!! Can this be done with items, too?? I mean an item wont auto cancel, but If I'm making a trade i can see if i offered a pet and not offer it, but theres no *this item in already in a trade* under the item like it do with pets. I collect items to have 1 of every item, so i don't wanna accident offer like both copies of an item at the same time and then have to go back and find it again for my collection. 😂
Vincent Van Gogh. Everyone said to him, "You can't be a great painter, you only have one ear." And you know what he said? "I can't hear you."

Image

Don't blame me, I voted for Kodos.
User avatar
odin
 
Posts: 8917
Joined: Fri Jul 23, 2010 2:57 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Trade Autocancel Warning Script

Postby winx » Wed Jan 22, 2025 3:53 pm

odin wrote:Super neat!!! Can this be done with items, too?? I mean an item wont auto cancel, but If I'm making a trade i can see if i offered a pet and not offer it, but theres no *this item in already in a trade* under the item like it do with pets. I collect items to have 1 of every item, so i don't wanna accident offer like both copies of an item at the same time and then have to go back and find it again for my collection. 😂


Added item functionality! Can download this update here: https://greasyfork.org/en/scripts/52335 ... her-trades

Please keep in mind that pets and items on CS are fundamentally different. Pets have unique IDs, meaning each pet is one-of-a-kind. When you search for a pet ID, it's the only version of that pet, and trading it away will automatically cancel any other trades containing that same pet. Items, on the other hand, do not have unique IDs. If you have the same item in two different trades, it won't automatically cancel unless you only have one copy of the item.

If I wanted to alert a user that they only had one copy of an item available, this would likely require iterating through their "My items" collection, identifying the item by ID, and then targeting the numerical value before "available". I couldn't figure it out this time, but I may revisit it in the future. I'm more-so concerned about how long it might take to iterate through every page until it hits a match, but that gets into convoluted sorting algorithm knowledge that no one wants to hear about lol.
Image

...........................................................
"I thank whatever gods may be
For my unconquerable soul.
"

Got a problem and
think CS staff could fix it?
Submit a ticket!

Got feedback or questions for me?
Share your thoughts anonymously here!

Image
Enter TOBP’s one-shot challenge
to have a chance at winning this
month’s store pet set!

...........................................................
User avatar
winx
Global Moderator
 
Posts: 5901
Joined: Tue Mar 17, 2009 1:51 pm
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Trade Autocancel Warning Script

Postby odin » Thu Jan 23, 2025 12:37 am

winx wrote:
odin wrote:Super neat!!! Can this be done with items, too?? I mean an item wont auto cancel, but If I'm making a trade i can see if i offered a pet and not offer it, but theres no *this item in already in a trade* under the item like it do with pets. I collect items to have 1 of every item, so i don't wanna accident offer like both copies of an item at the same time and then have to go back and find it again for my collection. 😂


Added item functionality! Can download this update here: https://greasyfork.org/en/scripts/52335 ... her-trades

Please keep in mind that pets and items on CS are fundamentally different. Pets have unique IDs, meaning each pet is one-of-a-kind. When you search for a pet ID, it's the only version of that pet, and trading it away will automatically cancel any other trades containing that same pet. Items, on the other hand, do not have unique IDs. If you have the same item in two different trades, it won't automatically cancel unless you only have one copy of the item.

If I wanted to alert a user that they only had one copy of an item available, this would likely require iterating through their "My items" collection, identifying the item by ID, and then targeting the numerical value before "available". I couldn't figure it out this time, but I may revisit it in the future. I'm more-so concerned about how long it might take to iterate through every page until it hits a match, but that gets into convoluted sorting algorithm knowledge that no one wants to hear about lol.

Thank you!! it will be very helpful for trading! <3 i never realized that about the items. does make it a bit more confusing. 😅
Vincent Van Gogh. Everyone said to him, "You can't be a great painter, you only have one ear." And you know what he said? "I can't hear you."

Image

Don't blame me, I voted for Kodos.
User avatar
odin
 
Posts: 8917
Joined: Fri Jul 23, 2010 2:57 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Trade Autocancel Warning Script

Postby winx » Sun Feb 02, 2025 5:51 pm

Small update to the script that you can download here!

Simon found a bug where the script would run when viewing shareable trade links, so that should be fixed now. (:
Image

...........................................................
"I thank whatever gods may be
For my unconquerable soul.
"

Got a problem and
think CS staff could fix it?
Submit a ticket!

Got feedback or questions for me?
Share your thoughts anonymously here!

Image
Enter TOBP’s one-shot challenge
to have a chance at winning this
month’s store pet set!

...........................................................
User avatar
winx
Global Moderator
 
Posts: 5901
Joined: Tue Mar 17, 2009 1:51 pm
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Trade Autocancel Warning Script

Postby Shirlyn » Tue Apr 22, 2025 4:05 am

Why wasn't this moved to the CS Trading Guides & Help Section yet :o Totally helpful :thumbup:
Image
Gɪғᴛᴇᴅ: 59 » ɢɪғᴛ ʙᴏᴍʙᴇʀ « Rᴇᴄᴇɪᴠᴇᴅ: 67
╔══ ❤ ════════════════════════════╗

+ 2ʜ CS Sɪᴛᴇ Tɪᴍᴇ
Iᴛᴇᴍs Lᴇғᴛ: 16 Sɪᴛᴇs
Fᴜʟʟ Cᴏʟʟᴇᴄᴛɪᴏɴ Pᴇᴛs Lᴇғᴛ: 574


Mʏ FR Aᴄᴄᴏᴜɴᴛ
Tʀᴀᴅᴇ Wɪᴛʜ MᴇMʏ Tʀᴀᴅɪɴɢ Tʜʀᴇᴀᴅ


╚════════════════════════════ ❤ ══╝
User avatar
Shirlyn
 
Posts: 2434
Joined: Tue Oct 18, 2011 2:34 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Who is online

Users browsing this forum: caesou, Fleckenpferd, Reiemye and 12 guests