Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to start a random callout

Featured Replies

How can I let LSPDFR start a random callout? Something like

Functions.StartCallout();

But then that it starts a random callout, and that I don't have to specify one.

Functions.StartCallout takes a string parameter, this is the name specified in CalloutInfo. To achieve this, we have to get this name from all available callouts. We can do this by searching through all assemblies with a base type of Callout, retrieving the name specified in CalloutInfo, and caching it into a list of strings. When we want to trigger a random callout, we access this list and randomly choose a string with no conditions. Credit goes to Stealth22, he (as far as I know) wrote the base code for going through all callouts that I've made use of here. Gist is below with untested mock up code that should theoretically work:

 

https://gist.githubusercontent.com/RiverGrande/d27b7506d5eb1372e53f1840a8a647c8/raw/a71c93eb007f9b35e3b1e376026624507779f40e/RandomCallouts.cs

Edited by liverlande

  • Author
5 minutes ago, liverlande said:

Functions.StartCallout takes a string parameter, this is the name specified in CalloutInfo. To achieve this, we have to get this name from all available callouts. We can do this by searching through all assemblies with a base type of Callout, retrieving the name specified in CalloutInfo, and caching it into a list of strings. When we want to trigger a random callout, we access this list and randomly choose a string with no conditions. Credit goes to Stealth22, he (as far as I know) wrote the base code for going through all callouts that I've made use of here. Gist is below with untested mock up code that should theoretically work:

 

https://gist.githubusercontent.com/RiverGrande/d27b7506d5eb1372e53f1840a8a647c8/raw/a71c93eb007f9b35e3b1e376026624507779f40e/RandomCallouts.cs

Thanks for the reply, this will help.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.