ULX

Author Topic: Interval in Adverts  (Read 9467 times)

0 Members and 1 Guest are viewing this topic.

Offline Fluffedwolf

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
Interval in Adverts
« on: January 18, 2014, 12:43:47 PM »
It would be much better if the intervals on the advertisements would be like ever so and so instead this message plays after so this message plays after so. It would be much more organized

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Interval in Adverts
« Reply #1 on: January 18, 2014, 12:54:06 PM »
This is actually a great idea!
My adverts always seem to show over each other.
Out of the Garry's Mod business.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Interval in Adverts
« Reply #2 on: January 18, 2014, 03:02:31 PM »
They can already be put into groups.
From the default adverts.txt
Quote
If you want to make it so that one advertisement is shown and then will always be followed by another,
; put them in a table. For example, if you add the following to the bottom of the file, A will always show
; first followed by B.
 "my_group"
; {
; {
; "text" "Advertisement A"
; "time" "200"
; }
; {
; "text" "Advertisement B"
; "time" "300"
; }
; }

I'm pretty sure XGUI allows for grouping.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Fluffedwolf

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
Re: Interval in Adverts
« Reply #3 on: January 18, 2014, 03:41:59 PM »
As I said it should be so you say you want a message every 200 seconds then you place the interval 200 and each advert goes 200 after another. In ulx the max is 1000.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Interval in Adverts
« Reply #4 on: January 18, 2014, 04:17:03 PM »
No, XGUI sets the highest number as 1000.
You can set up manually if you really want it higher, go to your gmod/data/ulx/adverts.txt and edit it.
XGUI does allow the way your asking already, just not as high as it seems you want.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Storm

  • Full Member
  • ***
  • Posts: 220
  • Karma: 4
Re: Interval in Adverts
« Reply #5 on: January 18, 2014, 05:59:31 PM »
I have always had a problem with overlapping adverts. I always thought each was zero-based like 60 means every 60 seconds but do you mean the time represents the time after the last one?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Interval in Adverts
« Reply #6 on: January 18, 2014, 09:55:23 PM »
ULX has two types - grouped and non-grouped.
Non grouped are zero based. Will show up at whatever time specified, individually.
Two adverts
Advert 1 at 60 seconds
advert 2 at 65 seconds
Second time, 1 will show up at 120, 2 will show up at 130

Grouped, 2nd add will always show up constant <x> after first>.
They're consecutive.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Interval in Adverts
« Reply #7 on: January 18, 2014, 10:17:14 PM »
JamminR is right. Except, XGUI also allows you to input the value you want for the time rather than using the slider, so there's no need to go to the file to set it higher if that's what you want.
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Interval in Adverts
« Reply #8 on: January 18, 2014, 10:43:22 PM »
allows you to input the value you want for the time rather than using the slider
I thought we had BOTH input and sliders.
Text input boxes + lazy sliders FTW.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline sabo

  • Full Member
  • ***
  • Posts: 136
  • Karma: 2
  • Hello :)
    • The Elite Gaming
Re: Interval in Adverts
« Reply #9 on: January 19, 2014, 08:26:42 AM »
Use the lua file in the attachments, put it to garrysmod/lua/autorun/...

This will basically print the adverts one by one, 1st then 2nd then 3rd then 4th ect...

The time between those adverts is configureable at the top.

This way it will never override a previous advert.

The script was made by a friend and given to me, the adverts are my own, feel free to keep/delete them to your liking.

Hope this helps.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Interval in Adverts
« Reply #10 on: January 19, 2014, 09:44:31 AM »
Sabo, why replace the functionality of ULX?
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Interval in Adverts
« Reply #11 on: January 19, 2014, 01:18:57 PM »
Er... isn't lenny_ a hack?
Out of the Garry's Mod business.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Interval in Adverts
« Reply #12 on: January 19, 2014, 01:20:33 PM »
Er... isn't lenny_ a hack?
The code is all legit, soooo... guess not.
bw81@ulysses-forums ~ % whoami
Homepage

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Interval in Adverts
« Reply #13 on: January 19, 2014, 01:38:13 PM »
The code is all legit, soooo... guess not.

...Still not trusting that.

EDIT: Nevermind, I just took a look at the code. Seems clean.
Strange name to give a script though.
« Last Edit: January 19, 2014, 01:44:41 PM by Neku »
Out of the Garry's Mod business.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Interval in Adverts
« Reply #14 on: January 19, 2014, 01:53:49 PM »
...Still not trusting that.

EDIT: Nevermind, I just took a look at the code. Seems clean.
Strange name to give a script though.
You- you don't trust me? D:
I took a look at the code before I said that. .-.
bw81@ulysses-forums ~ % whoami
Homepage