• Print

Author Topic: Derma not sending space(s) to ulx  (Read 4852 times)

0 Members and 1 Guest are viewing this topic.

Offline Tomzen

  • Full Member
  • ***
  • Posts: 115
  • Karma: -1
  • A new lua adventurer
    • Thirdage Gaming
Derma not sending space(s) to ulx
« on: June 04, 2015, 02:20:25 am »
Sup, creating a menu for my "Search" addon, it's pretty much finished except for one problem, what ever is written in the "DTextEntry" will not send further then the first space, example if type "Extreme Memes" it will come up with "Extreme" only.

I know that the spaces are going through because If I use print, it shows correctly in console, but the link will only open before the space:
Code: Lua
  1.         STextDerma.OnEnter = function(self) -- What to search?
  2.                         local cmd2run = "ulx search google " .. self:GetValue()
  3.                         print( cmd2run )
  4.                         LocalPlayer():ConCommand( cmd2run )
  5.         end    

The following above would print in console (example): "ulx search google Extreme Memes", but the link that opens only contains "Extreme" and no further. It works without the derma menu, and the derma menu works if you use %20 (unfortunately I can't gsub spaces with %20)
« Last Edit: June 04, 2015, 02:22:56 am by Tomzen »
Finished:
Impersonate
<==> FakePromote/Demote <==> RandomMap <==> ForceMic <==> Search <==> PlayMenu <==
WIP:
ServerMode <==

Offline Tomzen

  • Full Member
  • ***
  • Posts: 115
  • Karma: -1
  • A new lua adventurer
    • Thirdage Gaming
Re: Derma not sending space(s) to ulx
« Reply #1 on: June 04, 2015, 07:35:02 am »
No one know a solution?
Finished:
Impersonate
<==> FakePromote/Demote <==> RandomMap <==> ForceMic <==> Search <==> PlayMenu <==
WIP:
ServerMode <==

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: Derma not sending space(s) to ulx
« Reply #2 on: June 04, 2015, 08:52:08 am »
If I'm remembering correctly, you may put your command arguments in separated by commas, like so:

Code: Lua
  1. LocalPlayer():ConCommand( "ulx", "search", "google", self:GetValue() )
(I'm not sure if you need to split self:GetValue() by spaces into a table then pass that in as well)
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Derma not sending space(s) to ulx
« Reply #3 on: June 04, 2015, 04:02:14 pm »
No one know a solution?
After 4 hours?????!
Give at least 3-4 days before asking.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Aharon Tager

  • Newbie
  • *
  • Posts: 37
  • Karma: 0
    • Barely Legal Gaming
Re: Derma not sending space(s) to ulx
« Reply #4 on: June 07, 2015, 07:40:50 am »
It should for sure work if you type the search in quotes since that returns it all

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: Derma not sending space(s) to ulx
« Reply #5 on: June 07, 2015, 09:26:21 am »
Code: Lua
  1. local cmd2run = "ulx search google " .. self:GetValue()

I'm not sure if you're using ULib.cmds.takeRestOfLine, but if you are not, you would have to put quotes around the key words.

Code: Lua
  1. local cmd2run = "ulx search google \"" .. self:GetValue() .. "\""
« Last Edit: June 07, 2015, 09:27:56 am by Aaron113 »

Offline Tomzen

  • Full Member
  • ***
  • Posts: 115
  • Karma: -1
  • A new lua adventurer
    • Thirdage Gaming
Re: Derma not sending space(s) to ulx
« Reply #6 on: June 08, 2015, 01:14:49 am »
I'm not sure if you're using ULib.cmds.takeRestOfLine, but if you are not, you would have to put quotes around the key words.

Code: Lua
  1. local cmd2run = "ulx search google \"" .. self:GetValue() .. "\""

Thanks.
Finished:
Impersonate
<==> FakePromote/Demote <==> RandomMap <==> ForceMic <==> Search <==> PlayMenu <==
WIP:
ServerMode <==

  • Print