[0.11.22] Recipe Clipboard [WIP/First]

Topics and discussion about specific mods
Post Reply
leflings
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Sep 16, 2014 5:13 am
Contact:

[0.11.22] Recipe Clipboard [WIP/First]

Post by leflings »

Hi guys

This is my first attempt at a mod, so any criticism/advice on improvements are welcome :)

Project homepage: https://github.com/leflings/RecipeClipboard

The homepage contains a more detailed readme.

Recipe Clipboard adds the ability to

[*] Copy the ingredient list and count from any assembling machine (or anything with a recipe configured)
[*] Copy the product item from any assembling machine
[*] Paste ingredient list and count to logistic chest
[*] Paste recipe product item to any smart capable inserter
Attachments
paste_inserter.jpg
paste_inserter.jpg (582.82 KiB) Viewed 21879 times
paste_chest.jpg
paste_chest.jpg (579.08 KiB) Viewed 21879 times
copy.jpg
copy.jpg (490.86 KiB) Viewed 21879 times

User avatar
Xterminator
Filter Inserter
Filter Inserter
Posts: 981
Joined: Sun Jun 15, 2014 4:49 pm
Contact:

Re: [0.11.22] Recipe Clipboard [WIP/First]

Post by Xterminator »

This is awesome! Wanted something like this for a long time. Keep up the good work, I will definitely be using this. :D
Image Image Image

User avatar
Takezu
Fast Inserter
Fast Inserter
Posts: 247
Joined: Sun May 10, 2015 5:46 pm
Contact:

Re: [0.11.22] Recipe Clipboard [WIP/First]

Post by Takezu »

Nice one, but how about including the zip for download ;)

Or i'm supposed do run over to git ;)

User avatar
MagicLegend
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Tue Dec 30, 2014 6:17 pm
Contact:

Re: [0.11.22] Recipe Clipboard [WIP/First]

Post by MagicLegend »

Looks really cool! This is something that should be in the basegame! :D

~ML

Ps. I'll test this mod with Dytech for you :)
Very good at pressing buttons.

deepdriller
Fast Inserter
Fast Inserter
Posts: 185
Joined: Sat Apr 11, 2015 7:52 pm
Contact:

Re: [0.11.22] Recipe Clipboard [WIP/First]

Post by deepdriller »

Wait... what'S the difference to Shift+LeftClick/Shift+RightcCick?

User avatar
Takezu
Fast Inserter
Fast Inserter
Posts: 247
Joined: Sun May 10, 2015 5:46 pm
Contact:

Re: [0.11.22] Recipe Clipboard [WIP/First]

Post by Takezu »

Shift click works only if the entitys are the same, means from chest to hest or chem plant to chemplant, this works from assembler to requester chest and alike.

Blob
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Jun 05, 2015 4:27 pm
Contact:

Re: [0.11.22] Recipe Clipboard [WIP/First]

Post by Blob »

When loading saved MP game. What can I do?
sshot-1.png
sshot-1.png (20.94 KiB) Viewed 21651 times

jorgenRe
Filter Inserter
Filter Inserter
Posts: 535
Joined: Wed Apr 09, 2014 3:32 pm
Contact:

Re: [0.11.22] Recipe Clipboard [WIP/First]

Post by jorgenRe »

Blob wrote:When loading saved MP game. What can I do?
The attachment sshot-1.png is no longer available
THat is because this is a single player mod :/!
THOUGH it should be possible to make it multiplayer compatible at the very least (atleast so 1 player can use it) :)!
Putting up a fix for you:
Do note that the only thing i did was to change:
game.player. to --> game.players[1].
Now how to make it work with all the players in a multiplayer game you will need to make it check which player it was that did it! Hence the talk about the for loop down under:

Code: Select all

game.onevent(defines.events.ontick,
  function(e)
  --Now i havent read through the code but adding a for i = 1, numPlayers on do 
  --loop you should be able to make it possible to use this mod with more than just 1 player! Remember to change
  --the 1 with i as players[1] Just means player number 1 in a multiplayer game OR the player in singleplayer so it works even
  --In singleplayer!
    if game.players[1].opened then
      if pcall(function() return game.players[1].opened.recipe end) then
        if not getBtn('copyButton') then
          dbg('+ Copy button')
          createButton('Copy Build Requirements', 'copyButton')
        end
      elseif game.players[1].opened.name == 'logistic-chest-requester' then
        if not getBtn('pasteButton') then
          dbg(' + Paste Button')
           createButton('Paste Build Requirements', 'pasteButton')
        end
      elseif game.players[1].opened.type == 'inserter' then
        if not getBtn('pasteButton') then
          if string.find(game.players[1].opened.name, "smart") then
            createButton('Paste Build Requirements', 'pasteButton')
          end
        end
      end
    else
      if getBtn('copyButton') then
        dbg(' - Copy Button')
        getBtn('copyButton').destroy()
      end
      if getBtn('pasteButton')  then
        dbg(' - Paste Button')
          getBtn('pasteButton').destroy()
      end
    end
  end)
Attachments
MultiplayerFixClipBoardMod.zip
This works for multiplayer games too!
(1.64 KiB) Downloaded 277 times
Logo
Noticed the told change in FFF #111 so il continue to use my signature ^_^
Thanks for listening to our suggestions, devs :D!
I would jump of joy if we could specify which tiles spawned in a surfaces

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.11.22] Recipe Clipboard [WIP/First]

Post by orzelek »

If you want to make it compatible with multiplayer I think there is a player index in the event object. I know for sure that player created event carries it.

leflings
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Sep 16, 2014 5:13 am
Contact:

Re: [0.11.22] Recipe Clipboard [WIP/First]

Post by leflings »

Hey guys

Thanks for the kind words.

Yeah, in this initial release, I did nothing to enable multiplayer, because I have never tried it. From what I can tell, and others are writing, it would be a small deal to add in support for. Sadly, this releasing this mod, I've barely had time to play Factorio myself, much less do further development on the mod. And it will be another week before I'm back from vacation, to look at these things again.

jorgenRe
Filter Inserter
Filter Inserter
Posts: 535
Joined: Wed Apr 09, 2014 3:32 pm
Contact:

Re: [0.11.22] Recipe Clipboard [WIP/First]

Post by jorgenRe »

leflings wrote:Hey guys

Thanks for the kind words.

Yeah, in this initial release, I did nothing to enable multiplayer, because I have never tried it. From what I can tell, and others are writing, it would be a small deal to add in support for. Sadly, this releasing this mod, I've barely had time to play Factorio myself, much less do further development on the mod. And it will be another week before I'm back from vacation, to look at these things again.
I think when you save it it should be saved in a table like this: date = table[playerNumb][1]
Then when it pastes it reades, who clicked the button and put the player number in the table:
paste = table[player1][1]
Logo
Noticed the told change in FFF #111 so il continue to use my signature ^_^
Thanks for listening to our suggestions, devs :D!
I would jump of joy if we could specify which tiles spawned in a surfaces

Koub
Global Moderator
Global Moderator
Posts: 7203
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: [0.11.22] Recipe Clipboard [WIP/First]

Post by Koub »

[Moved to helper mods by Koub]
Koub - Please consider English is not my native language.

Post Reply

Return to “Mods”